public final class LoopBeginNode extends AbstractMergeNode implements IterableNodeType, LIRLowerable
| Modifier and Type | Class and Description |
|---|---|
static class |
LoopBeginNode.LoopType |
Node.ConstantNodeParameter, Node.EdgeVisitor, Node.IndirectCanonicalization, Node.InjectedNodeParameter, Node.Input, Node.NodeInsertionStackTrace, Node.NodeIntrinsic, Node.NodeIntrinsicFactory, Node.OptionalInput, Node.Successor, Node.ValueNumberable| Modifier and Type | Field and Description |
|---|---|
protected boolean |
canNeverOverflow
Flag indicating that this loop can never overflow based on some property not visible in the
loop control computations.
|
protected boolean |
compilerInverted |
protected boolean |
disableCounted
Flag to indicate that this loop must not be detected as a counted loop.
|
static SpeculationReasonGroup |
LOOP_OVERFLOW_DEOPT |
protected double |
loopOrigFrequency |
protected LoopBeginNode.LoopType |
loopType |
protected int |
nextEndIndex |
protected boolean |
osrLoop |
static CounterKey |
overflowSpeculationNotTaken |
static CounterKey |
overflowSpeculationTaken |
protected int |
peelings |
protected GuardingNode |
protectedNonOverflowingUnsigned
A
GuardingNode protecting an unsigned inverted counted loop. |
protected boolean |
rotated |
protected int |
splits |
protected boolean |
stripMinedInner |
protected int |
stripMinedLimit |
protected boolean |
stripMinedOuter |
static NodeClass<LoopBeginNode> |
TYPE |
protected int |
unrollFactor |
protected int |
unswitches |
endsstateAfternextEMPTY_ARRAY, stampNODE_LIST, NOT_ITERABLE, TRACK_CREATION_POSITION, WithAllEdges, WithNoEdges, WithOnlyInputEdges, WithOnlySucessorEdges| Constructor and Description |
|---|
LoopBeginNode() |
addForwardEnd, cfgPredecessors, clearEnds, duplicateReturnThroughMerge, forwardEndAt, forwardEndCount, forwardEndIndex, forwardEnds, isPhiAtMerge, memoryPhis, phis, removeEnd, valuePhishasSideEffect, setStateAfter, stateAftergetBlockNodes, guards, hasAnchored, hasSpeculationFence, isUsedAsGuardInput, prepareDelete, prepareDelete, prevBegin, setHasSpeculationFenceasFixedWithNextNode, next, setNextasFixedNodeasConstant, asJavaConstant, asNode, asSerializableConstant, checkReplaceAtUsagesInvariants, getStackKind, graph, hasUsagesOtherThan, inferStamp, isAllowedUsageType, isConstant, isConstantPredicate, isDefaultConstant, isIllegalConstant, isJavaConstant, isNullConstant, isSerializableConstant, recursivelyDataFlowEqualsUpTo, setStamp, stamp, updateStamp, updateUsagesInterfaceafterClone, applyInputs, applySuccessors, assertFalse, assertTrue, cfgSuccessors, clearInputs, clearNodeSourcePosition, clearSuccessors, copyWithInputs, copyWithInputs, dataFlowEquals, dynamicNodeSizeEstimate, estimatedNodeCycles, estimatedNodeSize, fail, formatTo, getCreationPosition, getDebug, getDebugProperties, getDebugProperties, getInsertionPosition, getNodeClass, getNodeSourcePosition, getOptions, getUsageCount, hasExactlyOneUsage, hashCode, hasMoreThanOneUsage, hasNoUsages, hasOnlyUsagesOfType, hasUsages, hasUsagesOfType, inputPositions, inputs, isAlive, isDeleted, isUnregistered, markDeleted, maybeNotifyZeroUsages, modCount, predecessor, pushInputs, removeUsage, replaceAllInputs, replaceAndDelete, replaceAtAllUsages, replaceAtMatchingUsages, replaceAtPredecessor, replaceAtUsages, replaceAtUsages, replaceAtUsages, replaceAtUsages, replaceAtUsages, replaceAtUsagesAndDelete, replaceAtUsagesAndDelete, replaceFirstInput, replaceFirstSuccessor, safeDelete, setCreationPosition, setInsertionPosition, setNodeSourcePosition, singleUsage, successorPositions, successors, toString, toString, updateNodeSourcePosition, updatePredecessor, updateUsages, usages, valueEquals, verifyEdges, verifyInputs, verifySourcePosition, withNodeSourcePositionclone, equals, getClass, notify, notifyAll, wait, wait, waitstatesasFixedNodeasNodepublic static final NodeClass<LoopBeginNode> TYPE
protected double loopOrigFrequency
protected int nextEndIndex
protected int unswitches
protected int splits
protected int peelings
protected boolean compilerInverted
protected LoopBeginNode.LoopType loopType
protected int unrollFactor
protected boolean osrLoop
protected boolean stripMinedOuter
protected boolean stripMinedInner
protected boolean rotated
protected int stripMinedLimit
protected boolean disableCounted
protected boolean canNeverOverflow
protected GuardingNode protectedNonOverflowingUnsigned
GuardingNode protecting an unsigned inverted counted loop. IntegerStamp
does not record information about the sign of a stamp, i.e., it cannot represent
IntegerStamp.upMask()} and IntegerStamp.downMask() in relation with unsigned
stamps. Thus, if we have such a guard we set it explicitly to a loop.
An example for such a loop would be
public static long foo(int start) {
if (Integer.compareUnsigned(start, 2) < 0) {
deoptimize();
}
int i = start;
do {
// body
i = i - 2;
} while (Integer.compareUnsigned(i, 2) >= 0);
return res;
}
Counted loop detection must ensure that start is |>| 1 else the loop would underflow unsigned
integer range immediately. The unsigned comparison with a deopt dominating the loop ensures
that start is always an unsigned integer in the range of [2,UnsignedIntMax], however this can
currently not be expressed with regular IntegerStamp.public static final CounterKey overflowSpeculationTaken
public static final CounterKey overflowSpeculationNotTaken
public static final SpeculationReasonGroup LOOP_OVERFLOW_DEOPT
public GuardingNode getUnsignedRangeGuard()
public void setUnsignedRangeGuard(GuardingNode guard)
public boolean isProtectedNonOverflowingUnsigned()
public void checkDisableCountedBySpeculation(int bci,
StructuredGraph graph)
public void setStripMinedLimit(int stripMinedLimit)
public int getStripMinedLimit()
public boolean canEndsSafepoint()
public boolean canEndsGuestSafepoint()
public void setStripMinedInner(boolean stripMinedInner)
public void setStripMinedOuter(boolean stripMinedOuter)
public boolean isStripMinedInner()
public boolean isStripMinedOuter()
public boolean canNeverOverflow()
public boolean isRotated()
public void setRotated(boolean rotated)
public void setCanNeverOverflow()
public boolean countedLoopDisabled()
public boolean isSimpleLoop()
public void setPreLoop()
public boolean isPreLoop()
public void setMainLoop()
public boolean isMainLoop()
public void setPostLoop()
public boolean isPostLoop()
public int getUnrollFactor()
public void setUnrollFactor(int currentUnrollFactor)
public void disableSafepoint()
loop ends.public void disableGuestSafepoint()
public double loopOrigFrequency()
public void setLoopOrigFrequency(double loopOrigFrequency)
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 LoopBeginNode.orderedLoopEnds().LoopEndNode that correspond to back-edges for this looppublic NodeIterable<LoopExitNode> loopExits()
public NodeIterable<Node> anchored()
anchored in class AbstractMergeNodepublic LoopEndNode[] orderedLoopEnds()
LoopEndNode that correspond to back-edges for this loop, in
increasing LoopBeginNode.phiPredecessorIndex(org.graalvm.compiler.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 boolean isSingleEntryLoop()
public EndNode forwardEnd()
public int splits()
public void incrementSplits()
public int peelings()
public void incrementPeelings()
public void generate(NodeLIRBuilderTool gen)
generate in interface LIRLowerablegenerate in class AbstractMergeNodeprotected void deleteEnd(AbstractEndNode end)
deleteEnd in class AbstractMergeNodepublic int phiPredecessorCount()
phiPredecessorCount in class AbstractMergeNodepublic int phiPredecessorIndex(AbstractEndNode pred)
phiPredecessorIndex in class AbstractMergeNodepublic AbstractEndNode phiPredecessorAt(int index)
phiPredecessorAt in class AbstractMergeNodepublic boolean verify()
verify in class AbstractMergeNodepublic int getLoopEndCount()
public int unswitches()
public void incrementUnswitches()
public boolean isCompilerInverted()
public void setCompilerInverted()
public void simplify(SimplifierTool tool)
AbstractMergeNodesimplify in interface Simplifiablesimplify in class AbstractMergeNodepublic boolean isLoopExit(AbstractBeginNode begin)
public LoopEndNode getSingleLoopEnd()
public void removeExits()
public GuardingNode getOverflowGuard()
public void setOverflowGuard(GuardingNode overflowGuard)
public void canonicalizePhis(SimplifierTool tool)
public void markOsrLoop()
public boolean isOsrLoop()
protected boolean verifyState()
verifyState in class AbstractMergeNode