Search in sources :

Example 31 with HighTierContext

use of org.graalvm.compiler.phases.tiers.HighTierContext in project graal by oracle.

the class GraalCompilerTest method getCustomGraphBuilderSuite.

protected PhaseSuite<HighTierContext> getCustomGraphBuilderSuite(GraphBuilderConfiguration gbConf) {
    PhaseSuite<HighTierContext> suite = getDefaultGraphBuilderSuite();
    ListIterator<BasePhase<? super HighTierContext>> iterator = suite.findPhase(GraphBuilderPhase.class);
    initializeInvocationPluginExtensions();
    GraphBuilderConfiguration gbConfCopy = editGraphBuilderConfiguration(gbConf.copy());
    iterator.remove();
    iterator.add(new GraphBuilderPhase(gbConfCopy));
    return suite;
}
Also used : GraphBuilderConfiguration(org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration) HighTierContext(org.graalvm.compiler.phases.tiers.HighTierContext) GraphBuilderPhase(org.graalvm.compiler.java.GraphBuilderPhase) BasePhase(org.graalvm.compiler.phases.BasePhase)

Example 32 with HighTierContext

use of org.graalvm.compiler.phases.tiers.HighTierContext in project graal by oracle.

the class GuardPrioritiesTest method prepareGraph.

private StructuredGraph prepareGraph(String method) {
    StructuredGraph graph = parseEager(method, StructuredGraph.AllowAssumptions.YES);
    HighTierContext highTierContext = getDefaultHighTierContext();
    CanonicalizerPhase canonicalizer = new CanonicalizerPhase();
    new ConvertDeoptimizeToGuardPhase().apply(graph, highTierContext);
    new LoweringPhase(canonicalizer, LoweringTool.StandardLoweringStage.HIGH_TIER).apply(graph, highTierContext);
    new FloatingReadPhase().apply(graph);
    return graph;
}
Also used : StructuredGraph(org.graalvm.compiler.nodes.StructuredGraph) LoweringPhase(org.graalvm.compiler.phases.common.LoweringPhase) CanonicalizerPhase(org.graalvm.compiler.phases.common.CanonicalizerPhase) HighTierContext(org.graalvm.compiler.phases.tiers.HighTierContext) FloatingReadPhase(org.graalvm.compiler.phases.common.FloatingReadPhase) ConvertDeoptimizeToGuardPhase(org.graalvm.compiler.phases.common.ConvertDeoptimizeToGuardPhase)

Example 33 with HighTierContext

use of org.graalvm.compiler.phases.tiers.HighTierContext in project graal by oracle.

the class BoxingEliminationTest method compareGraphs.

private void compareGraphs(final String snippet, final String referenceSnippet, final boolean loopPeeling, final boolean excludeVirtual) {
    graph = parseEager(snippet, AllowAssumptions.NO);
    HighTierContext context = getDefaultHighTierContext();
    CanonicalizerPhase canonicalizer = new CanonicalizerPhase();
    canonicalizer.apply(graph, context);
    new InliningPhase(new CanonicalizerPhase()).apply(graph, context);
    if (loopPeeling) {
        new LoopPeelingPhase(new DefaultLoopPolicies()).apply(graph, context);
    }
    new DeadCodeEliminationPhase().apply(graph);
    canonicalizer.apply(graph, context);
    new PartialEscapePhase(false, canonicalizer, graph.getOptions()).apply(graph, context);
    new DeadCodeEliminationPhase().apply(graph);
    canonicalizer.apply(graph, context);
    StructuredGraph referenceGraph = parseEager(referenceSnippet, AllowAssumptions.YES);
    new InliningPhase(new CanonicalizerPhase()).apply(referenceGraph, context);
    new DeadCodeEliminationPhase().apply(referenceGraph);
    new CanonicalizerPhase().apply(referenceGraph, context);
    assertEquals(referenceGraph, graph, excludeVirtual, true);
}
Also used : LoopPeelingPhase(org.graalvm.compiler.loop.phases.LoopPeelingPhase) PartialEscapePhase(org.graalvm.compiler.virtual.phases.ea.PartialEscapePhase) StructuredGraph(org.graalvm.compiler.nodes.StructuredGraph) DefaultLoopPolicies(org.graalvm.compiler.loop.DefaultLoopPolicies) CanonicalizerPhase(org.graalvm.compiler.phases.common.CanonicalizerPhase) HighTierContext(org.graalvm.compiler.phases.tiers.HighTierContext) InliningPhase(org.graalvm.compiler.phases.common.inlining.InliningPhase) DeadCodeEliminationPhase(org.graalvm.compiler.phases.common.DeadCodeEliminationPhase)

Example 34 with HighTierContext

use of org.graalvm.compiler.phases.tiers.HighTierContext in project graal by oracle.

the class BoxingEliminationTest method processMethod.

private void processMethod(final String snippet) {
    graph = parseEager(snippet, AllowAssumptions.NO);
    HighTierContext context = getDefaultHighTierContext();
    new InliningPhase(new CanonicalizerPhase()).apply(graph, context);
    new PartialEscapePhase(false, new CanonicalizerPhase(), graph.getOptions()).apply(graph, context);
}
Also used : PartialEscapePhase(org.graalvm.compiler.virtual.phases.ea.PartialEscapePhase) CanonicalizerPhase(org.graalvm.compiler.phases.common.CanonicalizerPhase) HighTierContext(org.graalvm.compiler.phases.tiers.HighTierContext) InliningPhase(org.graalvm.compiler.phases.common.inlining.InliningPhase)

Example 35 with HighTierContext

use of org.graalvm.compiler.phases.tiers.HighTierContext in project graal by oracle.

the class ConditionalEliminationMulTest method prepareGraph.

private StructuredGraph prepareGraph(String snippet) {
    StructuredGraph graph = parseEager(snippet, AllowAssumptions.NO);
    HighTierContext context = getDefaultHighTierContext();
    new ConditionalEliminationPhase(false).apply(graph, context);
    CanonicalizerPhase c = new CanonicalizerPhase();
    c.apply(graph, context);
    new ConditionalEliminationPhase(false).apply(graph, context);
    c.apply(graph, context);
    return graph;
}
Also used : StructuredGraph(org.graalvm.compiler.nodes.StructuredGraph) ConditionalEliminationPhase(org.graalvm.compiler.phases.common.ConditionalEliminationPhase) CanonicalizerPhase(org.graalvm.compiler.phases.common.CanonicalizerPhase) HighTierContext(org.graalvm.compiler.phases.tiers.HighTierContext)

Aggregations

HighTierContext (org.graalvm.compiler.phases.tiers.HighTierContext)71 StructuredGraph (org.graalvm.compiler.nodes.StructuredGraph)60 CanonicalizerPhase (org.graalvm.compiler.phases.common.CanonicalizerPhase)46 InliningPhase (org.graalvm.compiler.phases.common.inlining.InliningPhase)27 DebugContext (org.graalvm.compiler.debug.DebugContext)18 Test (org.junit.Test)18 ResolvedJavaMethod (jdk.vm.ci.meta.ResolvedJavaMethod)15 GraphBuilderPhase (org.graalvm.compiler.java.GraphBuilderPhase)13 OptionValues (org.graalvm.compiler.options.OptionValues)13 LoweringPhase (org.graalvm.compiler.phases.common.LoweringPhase)11 GraphBuilderConfiguration (org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration)10 DeadCodeEliminationPhase (org.graalvm.compiler.phases.common.DeadCodeEliminationPhase)10 DebugCloseable (org.graalvm.compiler.debug.DebugCloseable)8 Plugins (org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration.Plugins)8 InvocationPlugins (org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugins)8 PhaseContext (org.graalvm.compiler.phases.tiers.PhaseContext)7 PartialEscapePhase (org.graalvm.compiler.virtual.phases.ea.PartialEscapePhase)7 MetaAccessProvider (jdk.vm.ci.meta.MetaAccessProvider)6 DebugDumpScope (org.graalvm.compiler.debug.DebugDumpScope)6 PhaseSuite (org.graalvm.compiler.phases.PhaseSuite)6