src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTestBase.java
changeset 58877 aec7bf35d6f5
parent 58299 6df94ce3ab2f
equal deleted inserted replaced
58876:1a8d65e71a66 58877:aec7bf35d6f5
    67     protected void testConditionalElimination(String snippet, String referenceSnippet, boolean applyConditionalEliminationOnReference, boolean applyLowering) {
    67     protected void testConditionalElimination(String snippet, String referenceSnippet, boolean applyConditionalEliminationOnReference, boolean applyLowering) {
    68         StructuredGraph graph = parseEager(snippet, AllowAssumptions.YES);
    68         StructuredGraph graph = parseEager(snippet, AllowAssumptions.YES);
    69         DebugContext debug = graph.getDebug();
    69         DebugContext debug = graph.getDebug();
    70         debug.dump(DebugContext.BASIC_LEVEL, graph, "Graph");
    70         debug.dump(DebugContext.BASIC_LEVEL, graph, "Graph");
    71         CoreProviders context = getProviders();
    71         CoreProviders context = getProviders();
    72         CanonicalizerPhase canonicalizer1 = new CanonicalizerPhase();
    72         CanonicalizerPhase canonicalizer1 = createCanonicalizerPhase();
    73         CanonicalizerPhase canonicalizer = new CanonicalizerPhase();
    73         CanonicalizerPhase canonicalizer = createCanonicalizerPhase();
    74         try (DebugContext.Scope scope = debug.scope("ConditionalEliminationTest", graph)) {
    74         try (DebugContext.Scope scope = debug.scope("ConditionalEliminationTest", graph)) {
    75             prepareGraph(graph, canonicalizer1, context, applyLowering);
    75             prepareGraph(graph, canonicalizer1, context, applyLowering);
    76             new IterativeConditionalEliminationPhase(canonicalizer, true).apply(graph, context);
    76             new IterativeConditionalEliminationPhase(canonicalizer, true).apply(graph, context);
    77             canonicalizer.apply(graph, context);
    77             canonicalizer.apply(graph, context);
    78             canonicalizer.apply(graph, context);
    78             canonicalizer.apply(graph, context);
   104     }
   104     }
   105 
   105 
   106     public void testProxies(String snippet, int expectedProxiesCreated) {
   106     public void testProxies(String snippet, int expectedProxiesCreated) {
   107         StructuredGraph graph = parseEager(snippet, AllowAssumptions.YES);
   107         StructuredGraph graph = parseEager(snippet, AllowAssumptions.YES);
   108         CoreProviders context = getProviders();
   108         CoreProviders context = getProviders();
   109         CanonicalizerPhase canonicalizer1 = new CanonicalizerPhase();
   109         CanonicalizerPhase canonicalizer1 = CanonicalizerPhase.createWithoutCFGSimplification();
   110         canonicalizer1.disableSimplification();
       
   111         canonicalizer1.apply(graph, context);
   110         canonicalizer1.apply(graph, context);
   112         CanonicalizerPhase canonicalizer = new CanonicalizerPhase();
   111         CanonicalizerPhase canonicalizer = createCanonicalizerPhase();
   113         new LoweringPhase(canonicalizer, LoweringTool.StandardLoweringStage.HIGH_TIER).apply(graph, context);
   112         new LoweringPhase(canonicalizer, LoweringTool.StandardLoweringStage.HIGH_TIER).apply(graph, context);
   114         canonicalizer.apply(graph, context);
   113         canonicalizer.apply(graph, context);
   115 
   114 
   116         int baseProxyCount = graph.getNodes().filter(ProxyNode.class).count();
   115         int baseProxyCount = graph.getNodes().filter(ProxyNode.class).count();
   117         new ConditionalEliminationPhase(true).apply(graph, context);
   116         new ConditionalEliminationPhase(true).apply(graph, context);