public final class LoopBeginNode extends AbstractMergeNode implements IterableNodeType, LIRLowerable
Node.ConstantNodeParameter, Node.InjectedNodeParameter, Node.Input, Node.NodeIntrinsic, Node.OptionalInput, Node.Successor, Node.ValueNumberable
Modifier and Type | Field and Description |
---|---|
protected int |
inversionCount |
protected double |
loopFrequency |
protected int |
nextEndIndex |
private static int |
NO_INCREMENT |
(package private) GuardingNode |
overflowGuard |
static NodeClass<LoopBeginNode> |
TYPE |
protected int |
unswitches |
ends
stateAfter
next
NODE_LIST, NOT_ITERABLE, USE_UNSAFE_TO_CLONE, WithAllEdges, WithNoEdges, WithOnlyInputEdges, WithOnlySucessorEdges
Constructor and Description |
---|
LoopBeginNode() |
Modifier and Type | Method and Description |
---|---|
NodeIterable<Node> |
anchored() |
void |
canonicalizePhis(SimplifierTool tool)
Coalesces loop phis that represent the same value (which is not handled by normal Global
Value Numbering).
|
protected void |
deleteEnd(AbstractEndNode end) |
AbstractEndNode |
forwardEnd() |
void |
generate(NodeLIRBuilderTool gen) |
int |
getInversionCount() |
int |
getLoopEndCount() |
GuardingNode |
getOverflowGuard() |
private static int[] |
getSelfIncrements(PhiNode phi)
Returns an array with one entry for each input of the phi, which is either
NO_INCREMENT or the increment, i.e., the value by which the phi is incremented in
the corresponding branch. |
void |
incrementUnswitches() |
boolean |
isLoopExit(AbstractBeginNode begin) |
NodeIterable<LoopEndNode> |
loopEnds()
Returns the unordered set of
LoopEndNode that correspond to back-edges for
this loop. |
NodeIterable<LoopExitNode> |
loopExits() |
double |
loopFrequency() |
(package private) int |
nextEndIndex() |
LoopEndNode[] |
orderedLoopEnds()
Returns the set of
LoopEndNode that correspond to back-edges for this loop, in
increasing phiPredecessorIndex(com.oracle.graal.nodes.AbstractEndNode) order. |
AbstractEndNode |
phiPredecessorAt(int index) |
int |
phiPredecessorCount() |
int |
phiPredecessorIndex(AbstractEndNode pred) |
void |
removeDeadPhis()
Removes dead phi nodes hanging from this node.
|
void |
removeExits() |
void |
setInversionCount(int count) |
void |
setLoopFrequency(double loopFrequency) |
void |
setOverflowGuard(GuardingNode overflowGuard) |
void |
simplify(SimplifierTool tool)
This simplify method can deal with a null value for tool, so that it can be used outside of
canonicalization.
|
int |
unswitches() |
boolean |
verify() |
addForwardEnd, cfgPredecessors, clearEnds, forwardEndAt, forwardEndCount, forwardEndIndex, forwardEnds, isPhiAtMerge, phis, removeEnd, valuePhis
hasSideEffect, setStateAfter, stateAfter
getBlockNodes, guards, prepareDelete, prepareDelete, prevBegin, proxies, removeProxies
asNode, next, setNext
asConstant, asJavaConstant, getKind, graph, inferStamp, isAllowedUsageType, isConstant, isConstantPredicate, isNullConstant, setStamp, stamp, updateStamp
acceptInputs, acceptSuccessors, afterClone, assertFalse, assertTrue, cfgSuccessors, clearInputs, clearSuccessors, copyWithInputs, copyWithInputs, equals, fail, formatTo, getDebugProperties, getDebugProperties, getId, getNodeClass, getUsageAt, getUsageCount, hashCode, hasNoUsages, hasUsages, inputs, isAlive, isDeleted, markDeleted, modCount, newIdentityMap, newIdentityMap, newIdentityMap, newMap, newMap, newMap, newSet, newSet, predecessor, pushInputs, removeUsage, replaceAndDelete, replaceAtMatchingUsages, replaceAtPredecessor, replaceAtUsages, replaceAtUsages, replaceAtUsages, replaceFirstInput, replaceFirstSuccessor, safeDelete, successors, toString, toString, updatePredecessor, updateUsages, updateUsagesInterface, usages, valueEquals, verifyEdges, verifyInputs
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
asNode
states
asNode
asNode
public static final NodeClass<LoopBeginNode> TYPE
protected double loopFrequency
protected int nextEndIndex
protected int unswitches
protected int inversionCount
GuardingNode overflowGuard
private static final int NO_INCREMENT
public LoopBeginNode()
public double loopFrequency()
public void setLoopFrequency(double loopFrequency)
public NodeIterable<LoopEndNode> loopEnds()
LoopEndNode
that correspond to back-edges for
this loop. The order of the back-edges is unspecified, if you need to get an ordering
compatible for PhiNode
creation, use orderedLoopEnds()
.LoopEndNode
that correspond to back-edges for this looppublic NodeIterable<LoopExitNode> loopExits()
public NodeIterable<Node> anchored()
anchored
in class AbstractMergeNode
public LoopEndNode[] orderedLoopEnds()
LoopEndNode
that correspond to back-edges for this loop, in
increasing phiPredecessorIndex(com.oracle.graal.nodes.AbstractEndNode)
order. This method is suited to create new loop
PhiNode
.PhiNode phi = new ValuePhiNode(stamp, loop); phi.addInput(forwardEdgeValue); for (LoopEndNode loopEnd : loop.orderedLoopEnds()) { phi.addInput(backEdgeValue(loopEnd)); }
LoopEndNode
that correspond to back-edges for this looppublic AbstractEndNode forwardEnd()
public void generate(NodeLIRBuilderTool gen)
generate
in interface LIRLowerable
generate
in class AbstractMergeNode
protected void deleteEnd(AbstractEndNode end)
deleteEnd
in class AbstractMergeNode
public int phiPredecessorCount()
phiPredecessorCount
in class AbstractMergeNode
public int phiPredecessorIndex(AbstractEndNode pred)
phiPredecessorIndex
in class AbstractMergeNode
public AbstractEndNode phiPredecessorAt(int index)
phiPredecessorAt
in class AbstractMergeNode
public boolean verify()
verify
in class AbstractBeginNode
int nextEndIndex()
public int getLoopEndCount()
public int unswitches()
public void incrementUnswitches()
public int getInversionCount()
public void setInversionCount(int count)
public void simplify(SimplifierTool tool)
AbstractMergeNode
simplify
in interface Simplifiable
simplify
in class AbstractMergeNode
public boolean isLoopExit(AbstractBeginNode begin)
public void removeExits()
public GuardingNode getOverflowGuard()
public void setOverflowGuard(GuardingNode overflowGuard)
public void removeDeadPhis()
private static int[] getSelfIncrements(PhiNode phi)
NO_INCREMENT
or the increment, i.e., the value by which the phi is incremented in
the corresponding branch.public void canonicalizePhis(SimplifierTool tool)