src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/LoopUnswitchTest.java
equal
deleted
inserted
replaced
28 import org.graalvm.compiler.debug.DebugDumpScope; |
28 import org.graalvm.compiler.debug.DebugDumpScope; |
29 import org.graalvm.compiler.loop.DefaultLoopPolicies; |
29 import org.graalvm.compiler.loop.DefaultLoopPolicies; |
30 import org.graalvm.compiler.loop.phases.LoopUnswitchingPhase; |
30 import org.graalvm.compiler.loop.phases.LoopUnswitchingPhase; |
31 import org.graalvm.compiler.nodes.StructuredGraph; |
31 import org.graalvm.compiler.nodes.StructuredGraph; |
32 import org.graalvm.compiler.nodes.StructuredGraph.AllowAssumptions; |
32 import org.graalvm.compiler.nodes.StructuredGraph.AllowAssumptions; |
33 import org.graalvm.compiler.phases.common.CanonicalizerPhase; |
|
34 import org.junit.Test; |
33 import org.junit.Test; |
35 |
34 |
36 public class LoopUnswitchTest extends GraalCompilerTest { |
35 public class LoopUnswitchTest extends GraalCompilerTest { |
37 |
36 |
38 public static int referenceSnippet1(int a) { |
37 public static int referenceSnippet1(int a) { |
131 |
130 |
132 // Framestates create comparison problems |
131 // Framestates create comparison problems |
133 graph.clearAllStateAfter(); |
132 graph.clearAllStateAfter(); |
134 referenceGraph.clearAllStateAfter(); |
133 referenceGraph.clearAllStateAfter(); |
135 |
134 |
136 new CanonicalizerPhase().apply(graph, getProviders()); |
135 createCanonicalizerPhase().apply(graph, getProviders()); |
137 new CanonicalizerPhase().apply(referenceGraph, getProviders()); |
136 createCanonicalizerPhase().apply(referenceGraph, getProviders()); |
138 try (DebugContext.Scope s = debug.scope("Test", new DebugDumpScope("Test:" + snippet))) { |
137 try (DebugContext.Scope s = debug.scope("Test", new DebugDumpScope("Test:" + snippet))) { |
139 assertEquals(referenceGraph, graph); |
138 assertEquals(referenceGraph, graph); |
140 } catch (Throwable e) { |
139 } catch (Throwable e) { |
141 throw debug.handle(e); |
140 throw debug.handle(e); |
142 } |
141 } |