public abstract class EffectsClosure<BlockT extends EffectsBlockState<BlockT>> extends EffectsPhase.Closure<BlockT>
Modifier and Type | Class and Description |
---|---|
protected static class |
EffectsClosure.LoopKillCache |
protected class |
EffectsClosure.MergeProcessor
The main workhorse for merging states, both for loops and for normal merges.
|
Modifier and Type | Field and Description |
---|---|
protected NodeMap<ValueNode> |
aliases
If a node has an alias, this means that it was replaced with another node during analysis.
|
protected BlockMap<GraphEffectList> |
blockEffects
The effects accumulated during analysis of nodes.
|
protected ControlFlowGraph |
cfg |
protected boolean |
changed |
protected org.graalvm.compiler.virtual.phases.ea.EffectsClosure.EffectsClosureMode |
currentMode
The current execution mode: once we reach a maximum loop nest we stop further effects and
only perform the minimal necessary operations.
|
protected DebugContext |
debug |
protected org.graalvm.collections.EconomicMap<Loop<Block>,EffectsClosure.LoopKillCache> |
loopLocationKillCache |
protected org.graalvm.collections.EconomicMap<Loop<Block>,GraphEffectList> |
loopMergeEffects
Effects that can only be applied after the effects from within the loop have been applied and
that must be applied before any effect from after the loop is applied.
|
protected StructuredGraph.ScheduleResult |
schedule |
Constructor and Description |
---|
EffectsClosure(StructuredGraph.ScheduleResult schedule,
ControlFlowGraph cfg) |
Modifier and Type | Method and Description |
---|---|
void |
addScalarAlias(ValueNode node,
ValueNode alias) |
protected BlockT |
afterSplit(Block successor,
BlockT oldState)
Hook for subclasses to apply additional operations after
ReentrantBlockIterator.BlockIteratorClosure.cloneState(Object) for successor blocks. |
void |
applyEffects() |
protected abstract EffectsClosure.MergeProcessor |
createMergeProcessor(Block merge) |
ValueNode |
getScalarAlias(ValueNode node) |
boolean |
hasChanged() |
protected boolean |
hasScalarReplacedInputs(Node node) |
protected BlockT |
merge(Block merge,
List<BlockT> states)
Merge multiple states when processing
Block starting with a
AbstractMergeNode . |
boolean |
needsApplyEffects() |
protected BlockT |
processBlock(Block block,
BlockT state)
Process the current block with the current state during reverse post order iteration.
|
protected void |
processInitialLoopState(Loop<Block> loop,
BlockT initialState) |
protected void |
processKilledLoopLocations(Loop<Block> loop,
BlockT initialState,
BlockT mergedStates) |
protected List<BlockT> |
processLoop(Loop<Block> loop,
BlockT initialState) |
protected abstract void |
processLoopExit(LoopExitNode exitNode,
BlockT initialState,
BlockT exitState,
GraphEffectList effects) |
protected abstract boolean |
processNode(Node node,
BlockT state,
GraphEffectList effects,
FixedWithNextNode lastFixedNode)
Collects the effects of virtualizing the given node.
|
protected void |
processStateBeforeLoopOnOverflow(BlockT initialState,
FixedNode materializeBefore,
GraphEffectList effects) |
protected BlockT |
stripKilledLoopLocations(Loop<Block> loop,
BlockT initialState) |
cloneState, getInitialState
protected final ControlFlowGraph cfg
protected final StructuredGraph.ScheduleResult schedule
protected NodeMap<ValueNode> aliases
protected BlockMap<GraphEffectList> blockEffects
protected org.graalvm.collections.EconomicMap<Loop<Block>,GraphEffectList> loopMergeEffects
protected org.graalvm.collections.EconomicMap<Loop<Block>,EffectsClosure.LoopKillCache> loopLocationKillCache
protected boolean changed
protected final DebugContext debug
protected org.graalvm.compiler.virtual.phases.ea.EffectsClosure.EffectsClosureMode currentMode
public EffectsClosure(StructuredGraph.ScheduleResult schedule, ControlFlowGraph cfg)
public boolean hasChanged()
hasChanged
in class EffectsPhase.Closure<BlockT extends EffectsBlockState<BlockT>>
public boolean needsApplyEffects()
needsApplyEffects
in class EffectsPhase.Closure<BlockT extends EffectsBlockState<BlockT>>
public void applyEffects()
applyEffects
in class EffectsPhase.Closure<BlockT extends EffectsBlockState<BlockT>>
protected BlockT processBlock(Block block, BlockT state)
ReentrantBlockIterator.BlockIteratorClosure
processBlock
in class ReentrantBlockIterator.BlockIteratorClosure<BlockT extends EffectsBlockState<BlockT>>
protected BlockT afterSplit(Block successor, BlockT oldState)
ReentrantBlockIterator.BlockIteratorClosure
ReentrantBlockIterator.BlockIteratorClosure.cloneState(Object)
for successor blocks.afterSplit
in class ReentrantBlockIterator.BlockIteratorClosure<BlockT extends EffectsBlockState<BlockT>>
protected abstract boolean processNode(Node node, BlockT state, GraphEffectList effects, FixedWithNextNode lastFixedNode)
true
if the effects include removing the node, false
otherwise.protected BlockT merge(Block merge, List<BlockT> states)
ReentrantBlockIterator.BlockIteratorClosure
Block
starting with a
AbstractMergeNode
.merge
in class ReentrantBlockIterator.BlockIteratorClosure<BlockT extends EffectsBlockState<BlockT>>
protected final List<BlockT> processLoop(Loop<Block> loop, BlockT initialState)
processLoop
in class ReentrantBlockIterator.BlockIteratorClosure<BlockT extends EffectsBlockState<BlockT>>
protected void processStateBeforeLoopOnOverflow(BlockT initialState, FixedNode materializeBefore, GraphEffectList effects)
protected BlockT stripKilledLoopLocations(Loop<Block> loop, BlockT initialState)
protected void processKilledLoopLocations(Loop<Block> loop, BlockT initialState, BlockT mergedStates)
protected void processInitialLoopState(Loop<Block> loop, BlockT initialState)
protected abstract void processLoopExit(LoopExitNode exitNode, BlockT initialState, BlockT exitState, GraphEffectList effects)
protected abstract EffectsClosure.MergeProcessor createMergeProcessor(Block merge)
protected final boolean hasScalarReplacedInputs(Node node)