src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/LoopFullUnrollTest.java
changeset 55509 d58442b8abc1
parent 52910 583fd71c47d6
child 58299 6df94ce3ab2f
equal deleted inserted replaced
55508:a6e2d06391d6 55509:d58442b8abc1
    29 import org.graalvm.compiler.loop.DefaultLoopPolicies;
    29 import org.graalvm.compiler.loop.DefaultLoopPolicies;
    30 import org.graalvm.compiler.loop.phases.LoopFullUnrollPhase;
    30 import org.graalvm.compiler.loop.phases.LoopFullUnrollPhase;
    31 import org.graalvm.compiler.nodes.LoopBeginNode;
    31 import org.graalvm.compiler.nodes.LoopBeginNode;
    32 import org.graalvm.compiler.nodes.StructuredGraph;
    32 import org.graalvm.compiler.nodes.StructuredGraph;
    33 import org.graalvm.compiler.nodes.StructuredGraph.AllowAssumptions;
    33 import org.graalvm.compiler.nodes.StructuredGraph.AllowAssumptions;
       
    34 import org.graalvm.compiler.nodes.spi.CoreProviders;
    34 import org.graalvm.compiler.phases.common.CanonicalizerPhase;
    35 import org.graalvm.compiler.phases.common.CanonicalizerPhase;
    35 import org.graalvm.compiler.phases.tiers.PhaseContext;
       
    36 import org.junit.Test;
    36 import org.junit.Test;
    37 
    37 
    38 public class LoopFullUnrollTest extends GraalCompilerTest {
    38 public class LoopFullUnrollTest extends GraalCompilerTest {
    39 
    39 
    40     public static int testMinToMax(int input) {
    40     public static int testMinToMax(int input) {
    86     private void test(String snippet, int loopCount) {
    86     private void test(String snippet, int loopCount) {
    87         DebugContext debug = getDebugContext();
    87         DebugContext debug = getDebugContext();
    88         try (DebugContext.Scope s = debug.scope(getClass().getSimpleName(), new DebugDumpScope(snippet))) {
    88         try (DebugContext.Scope s = debug.scope(getClass().getSimpleName(), new DebugDumpScope(snippet))) {
    89             final StructuredGraph graph = parseEager(snippet, AllowAssumptions.NO, debug);
    89             final StructuredGraph graph = parseEager(snippet, AllowAssumptions.NO, debug);
    90 
    90 
    91             PhaseContext context = new PhaseContext(getProviders());
    91             CoreProviders context = getProviders();
    92             new LoopFullUnrollPhase(new CanonicalizerPhase(), new DefaultLoopPolicies()).apply(graph, context);
    92             new LoopFullUnrollPhase(new CanonicalizerPhase(), new DefaultLoopPolicies()).apply(graph, context);
    93 
    93 
    94             assertTrue(graph.getNodes().filter(LoopBeginNode.class).count() == loopCount);
    94             assertTrue(graph.getNodes().filter(LoopBeginNode.class).count() == loopCount);
    95         } catch (Throwable e) {
    95         } catch (Throwable e) {
    96             throw debug.handle(e);
    96             throw debug.handle(e);