Search in sources :

Example 1 with LoopPartialUnrollPhase

use of org.graalvm.compiler.loop.phases.LoopPartialUnrollPhase in project graal by oracle.

the class LoopPartialUnrollTest method createSuites.

@Override
protected Suites createSuites(OptionValues opts) {
    Suites suites = super.createSuites(opts).copy();
    PhaseSuite<MidTierContext> mid = suites.getMidTier();
    ListIterator<BasePhase<? super MidTierContext>> iter = mid.findPhase(LoopPartialUnrollPhase.class);
    BasePhase<? super MidTierContext> partialUnoll = iter.previous();
    if (iter.previous().getClass() != FrameStateAssignmentPhase.class) {
        // Ensure LoopPartialUnrollPhase runs immediately after FrameStateAssignment, so it gets
        // priority over other optimizations in these tests.
        mid.findPhase(LoopPartialUnrollPhase.class).remove();
        ListIterator<BasePhase<? super MidTierContext>> fsa = mid.findPhase(FrameStateAssignmentPhase.class);
        fsa.add(partialUnoll);
    }
    return suites;
}
Also used : MidTierContext(org.graalvm.compiler.phases.tiers.MidTierContext) LoopPartialUnrollPhase(org.graalvm.compiler.loop.phases.LoopPartialUnrollPhase) BasePhase(org.graalvm.compiler.phases.BasePhase) Suites(org.graalvm.compiler.phases.tiers.Suites)

Aggregations

LoopPartialUnrollPhase (org.graalvm.compiler.loop.phases.LoopPartialUnrollPhase)1 BasePhase (org.graalvm.compiler.phases.BasePhase)1 MidTierContext (org.graalvm.compiler.phases.tiers.MidTierContext)1 Suites (org.graalvm.compiler.phases.tiers.Suites)1