public class DefaultLoopPolicies extends Object implements LoopPolicies
| Modifier and Type | Class and Description |
|---|---|
static class |
DefaultLoopPolicies.FullUnrollability
This enum represents the result of analyzing a loop for full unrolling.
|
static class |
DefaultLoopPolicies.Options |
LoopPolicies.UnswitchingDecision| Constructor and Description |
|---|
DefaultLoopPolicies() |
| Modifier and Type | Method and Description |
|---|---|
DefaultLoopPolicies.FullUnrollability |
canFullUnroll(LoopEx loop)
Determine whether the loop should be fully unrolled.
|
boolean |
shouldFullUnroll(LoopEx loop) |
boolean |
shouldPartiallyUnroll(LoopEx loop,
CoreProviders providers) |
boolean |
shouldPeel(LoopEx loop,
ControlFlowGraph cfg,
CoreProviders providers,
int peelingIteration) |
boolean |
shouldTryUnswitch(LoopEx loop) |
LoopPolicies.UnswitchingDecision |
shouldUnswitch(LoopEx loop,
org.graalvm.collections.EconomicMap<ValueNode,List<ControlSplitNode>> controlSplits)
Decide which control split invariant should be unswitched in the given loop.
|
public boolean shouldPeel(LoopEx loop, ControlFlowGraph cfg, CoreProviders providers, int peelingIteration)
shouldPeel in interface LoopPoliciespublic DefaultLoopPolicies.FullUnrollability canFullUnroll(LoopEx loop)
DefaultLoopPolicies.FullUnrollability.SHOULD_FULL_UNROLL if the loop should be fully unrolled. Otherwise,
returns some other member of DefaultLoopPolicies.FullUnrollability describing why the loop cannot or
should not be fully unrolled.public boolean shouldFullUnroll(LoopEx loop)
shouldFullUnroll in interface LoopPoliciespublic boolean shouldPartiallyUnroll(LoopEx loop, CoreProviders providers)
shouldPartiallyUnroll in interface LoopPoliciespublic boolean shouldTryUnswitch(LoopEx loop)
shouldTryUnswitch in interface LoopPoliciespublic LoopPolicies.UnswitchingDecision shouldUnswitch(LoopEx loop, org.graalvm.collections.EconomicMap<ValueNode,List<ControlSplitNode>> controlSplits)
LoopPoliciesshouldUnswitch in interface LoopPoliciesloop - the loop to unswitch.controlSplits - the invariant grouped by their condition.