Mercurial > hg > graal-compiler
changeset 16330:41d479400da8
Merge
line wrap: on
line diff
--- a/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/ReduceMaxTest.java Mon Jun 30 18:17:13 2014 +0200 +++ b/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/ReduceMaxTest.java Mon Jun 30 18:46:36 2014 +0200 @@ -22,9 +22,11 @@ */ package com.oracle.graal.compiler.hsail.test.lambda; +import com.amd.okra.OkraContext; import static com.oracle.graal.hotspot.HotSpotGraalRuntime.runtime; import com.oracle.graal.hotspot.HotSpotVMConfig; import static org.junit.Assert.*; +import static org.junit.Assume.assumeTrue; import org.junit.*; import java.util.*; @@ -72,6 +74,10 @@ @Test public void testReduce() { + + // The simulator does not support HSA local memory as of June 2014 + assumeTrue(OkraContext.isSimulator() == false); + // Handmade reduce does not support +UseCompressedOops HotSpotVMConfig config = runtime().getConfig(); if (config.useCompressedOops == true || config.useHSAILDeoptimization == true) {
--- a/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/ReduceMinTest.java Mon Jun 30 18:17:13 2014 +0200 +++ b/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/ReduceMinTest.java Mon Jun 30 18:46:36 2014 +0200 @@ -22,9 +22,11 @@ */ package com.oracle.graal.compiler.hsail.test.lambda; +import com.amd.okra.OkraContext; import static com.oracle.graal.hotspot.HotSpotGraalRuntime.runtime; import com.oracle.graal.hotspot.HotSpotVMConfig; import static org.junit.Assert.*; +import static org.junit.Assume.assumeTrue; import org.junit.*; import java.util.*; @@ -72,6 +74,10 @@ @Test public void testReduce() { + + // The simulator does not support HSA local memory as of June 2014 + assumeTrue(OkraContext.isSimulator() == false); + // Handmade reduce does not support +UseCompressedOops HotSpotVMConfig config = runtime().getConfig(); if (config.useCompressedOops == true || config.useHSAILDeoptimization == true) {
--- a/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/ReduceSumTest.java Mon Jun 30 18:17:13 2014 +0200 +++ b/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/ReduceSumTest.java Mon Jun 30 18:46:36 2014 +0200 @@ -22,9 +22,11 @@ */ package com.oracle.graal.compiler.hsail.test.lambda; -//import com.oracle.graal.compiler.common.GraalInternalError; +import com.amd.okra.OkraContext; import static com.oracle.graal.hotspot.HotSpotGraalRuntime.runtime; import com.oracle.graal.hotspot.HotSpotVMConfig; +import static org.junit.Assert.assertTrue; +import static org.junit.Assume.assumeTrue; import org.junit.*; import java.util.*; @@ -73,6 +75,10 @@ @Test public void testReduce() { + + // The simulator does not support HSA local memory as of June 2014 + assumeTrue(OkraContext.isSimulator() == false); + // Handmade reduce does not support +UseCompressedOops HotSpotVMConfig config = runtime().getConfig(); if (config.useCompressedOops == true || config.useHSAILDeoptimization == true) { @@ -89,10 +95,10 @@ // Get OptionalInt version kernel sumOffload = evaluate(true); - assert sumStream == sumOffload : "Offload sum is wrong, stream:" + sumStream + " != offload:" + sumOffload; + assertTrue(sumStream == sumOffload); // Get identity version kernel sumOffload = evaluateWithIdentity(true); - assert sumStream == sumOffload : "Offload sum is wrong, stream:" + sumStream + " != offload:" + sumOffload; + assertTrue(sumStream == sumOffload); } }
--- a/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/NoDeadCodeVerifyHandler.java Mon Jun 30 18:17:13 2014 +0200 +++ b/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/NoDeadCodeVerifyHandler.java Mon Jun 30 18:46:36 2014 +0200 @@ -25,6 +25,7 @@ import static com.oracle.graal.printer.NoDeadCodeVerifyHandler.Options.*; import java.util.*; +import java.util.concurrent.*; import com.oracle.graal.compiler.common.*; import com.oracle.graal.debug.*; @@ -52,6 +53,12 @@ // @formatter:on } + /** + * Only the first instance of failure at any point is shown. This will also be removed once all + * phases clean up their own dead code. + */ + private static final Map<String, Boolean> discovered = new ConcurrentHashMap<>(); + public void verify(Object object, String message) { if (NDCV.getValue() != OFF && object instanceof StructuredGraph) { StructuredGraph graph = (StructuredGraph) object; @@ -60,16 +67,20 @@ List<Node> after = graph.getNodes().snapshot(); assert after.size() <= before.size(); if (before.size() != after.size()) { - before.removeAll(after); - String prefix = message == null ? "" : message + ": "; - GraalInternalError error = new GraalInternalError("%sfound dead nodes in %s: %s", prefix, graph, before); - if (NDCV.getValue() == INFO) { - System.out.println(error.getMessage()); - } else if (NDCV.getValue() == VERBOSE) { - error.printStackTrace(System.out); - } else { - assert NDCV.getValue() == FATAL; - throw error; + if (discovered.put(message, Boolean.TRUE) == null) { + System.out.println("MESSAGE: " + message); + + before.removeAll(after); + String prefix = message == null ? "" : message + ": "; + GraalInternalError error = new GraalInternalError("%sfound dead nodes in %s: %s", prefix, graph, before); + if (NDCV.getValue() == INFO) { + System.out.println(error.getMessage()); + } else if (NDCV.getValue() == VERBOSE) { + error.printStackTrace(System.out); + } else { + assert NDCV.getValue() == FATAL; + throw error; + } } } }