public final class IfNode extends ControlSplitNode implements Simplifiable, LIRLowerable, IterableNodeType, SwitchFoldable
IfNode represents a branch that can go one of two directions depending on the outcome
of a comparison.| Modifier and Type | Class and Description |
|---|---|
static class |
IfNode.NodeColor |
Node.ConstantNodeParameter, Node.EdgeVisitor, Node.IndirectCanonicalization, Node.InjectedNodeParameter, Node.Input, Node.NodeInsertionStackTrace, Node.NodeIntrinsic, Node.NodeIntrinsicFactory, Node.OptionalInput, Node.Successor, Node.ValueNumberableSwitchFoldable.Helper, SwitchFoldable.KeyData, SwitchFoldable.QuickQueryKeyData, SwitchFoldable.QuickQueryList<T>| Modifier and Type | Field and Description |
|---|---|
protected ProfileData.BranchProbabilityData |
profileData |
static NodeClass<IfNode> |
TYPE |
EMPTY_ARRAY, stampNODE_LIST, NOT_ITERABLE, TRACK_CREATION_POSITION, WithAllEdges, WithNoEdges, WithOnlyInputEdges, WithOnlySucessorEdgesSORTER| Constructor and Description |
|---|
IfNode(LogicNode condition,
AbstractBeginNode trueSuccessor,
AbstractBeginNode falseSuccessor,
ProfileData.BranchProbabilityData profileData) |
IfNode(LogicNode condition,
FixedNode trueSuccessor,
FixedNode falseSuccessor,
ProfileData.BranchProbabilityData profileData) |
| Modifier and Type | Method and Description |
|---|---|
LogicNode |
condition() |
static Constant[] |
constantValues(ValueNode node,
AbstractMergeNode merge,
boolean allowNull)
Gets an array of constants derived from a node that is either a
ConstantNode or a
PhiNode whose input values are all constants. |
void |
cutOffCascadeNode()
Removes the successors of this node, while keeping it linked to the rest of the cascade.
|
void |
cutOffLowestCascadeNode()
Completely removes all successors from this node.
|
double |
defaultProbability()
Returns the probability of going to the default branch.
|
void |
eliminateNegation() |
AbstractBeginNode |
falseSuccessor()
Gets the false successor.
|
void |
generate(NodeLIRBuilderTool gen) |
AbstractBeginNode |
getDefault()
Returns the branch that will close this switch folding, assuming this is called on the lowest
node of the cascade.
|
Node |
getNextSwitchFoldableBranch()
Returns the direct successor in the branch to check for SwitchFoldability.
|
AbstractBeginNode |
getPrimarySuccessor()
Primary successor of the control split.
|
ProfileData.BranchProbabilityData |
getProfileData()
Returns the source of this node's knowledge about its successor probabilities.
|
AbstractBeginNode |
getSuccessor(boolean result) |
int |
getSuccessorCount()
Returns the number of successors.
|
double |
getTrueSuccessorProbability() |
int |
intKeyAt(int i)
Returns the value of the i-th key of this node.
|
boolean |
isInSwitch(ValueNode switchValue)
Determines whether the node should be folded in the current folding attempt.
|
boolean |
isNonInitializedProfile()
Heuristics that tries to determine whether or not a foldable node was profiled.
|
double |
keyProbability(int i)
Returns the probability of seeing the i-th key of this node.
|
AbstractBeginNode |
keySuccessor(int i)
Returns the branch to follow when seeing the i-th key of this node.
|
double |
probability(AbstractBeginNode successor) |
ProfileData.ProfileSource |
profileSource()
Returns the source of the information about branch probabilities of this node.
|
protected void |
removeThroughFalseBranch(SimplifierTool tool,
AbstractMergeNode merge) |
static boolean |
sameDestination(AbstractBeginNode succ1,
AbstractBeginNode succ2)
Check it these two blocks end up at the same place.
|
void |
setCondition(LogicNode x) |
void |
setFalseSuccessor(AbstractBeginNode node) |
boolean |
setProbability(AbstractBeginNode successor,
ProfileData.BranchProbabilityData profileData)
Attempts to set the probability for the given successor to the passed value (which has to be
in the range of 0.0 and 1.0).
|
void |
setTrueSuccessor(AbstractBeginNode node) |
void |
setTrueSuccessorProbability(ProfileData.BranchProbabilityData profileData) |
void |
simplify(SimplifierTool tool) |
AbstractBeginNode |
successor(boolean istrue)
Gets the node corresponding to the specified outcome of the branch.
|
ValueNode |
switchValue()
Returns the value that will be used as the switch input.
|
AbstractBeginNode |
trueSuccessor()
Gets the true successor.
|
protected ProfileData.BranchProbabilityData |
trueSuccessorProfile() |
boolean |
verify() |
boolean |
verifySourcePosition() |
successorProbabilitiesasFixedNodeasConstant, 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, cfgPredecessors, 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, withNodeSourcePositionclone, equals, getClass, notify, notifyAll, wait, wait, waitisDefaultSuccessor, keyCount, maybeIsInSwitch, sameSwitchValue, switchTransformationOptimizationasNodeprotected ProfileData.BranchProbabilityData profileData
public IfNode(LogicNode condition, FixedNode trueSuccessor, FixedNode falseSuccessor, ProfileData.BranchProbabilityData profileData)
public IfNode(LogicNode condition, AbstractBeginNode trueSuccessor, AbstractBeginNode falseSuccessor, ProfileData.BranchProbabilityData profileData)
public LogicNode condition()
public void setCondition(LogicNode x)
public AbstractBeginNode trueSuccessor()
public AbstractBeginNode falseSuccessor()
public double getTrueSuccessorProbability()
public void setTrueSuccessor(AbstractBeginNode node)
public void setFalseSuccessor(AbstractBeginNode node)
public AbstractBeginNode successor(boolean istrue)
istrue - true if the true successor is requested, false otherwisepublic void setTrueSuccessorProbability(ProfileData.BranchProbabilityData profileData)
protected ProfileData.BranchProbabilityData trueSuccessorProfile()
public double probability(AbstractBeginNode successor)
probability in class ControlSplitNodepublic void generate(NodeLIRBuilderTool gen)
generate in interface LIRLowerablepublic boolean verifySourcePosition()
verifySourcePosition in class Nodepublic void eliminateNegation()
public void simplify(SimplifierTool tool)
simplify in interface Simplifiablepublic Node getNextSwitchFoldableBranch()
SwitchFoldablegetNextSwitchFoldableBranch in interface SwitchFoldablepublic boolean isInSwitch(ValueNode switchValue)
SwitchFoldableisInSwitch in interface SwitchFoldableswitchValue - the value of the switch that will spawn through this folding attempt.SwitchFoldable.maybeIsInSwitch(LogicNode),
SwitchFoldable.sameSwitchValue(LogicNode, ValueNode)public void cutOffCascadeNode()
SwitchFoldablecutOffCascadeNode in interface SwitchFoldablepublic void cutOffLowestCascadeNode()
SwitchFoldablecutOffLowestCascadeNode in interface SwitchFoldablepublic AbstractBeginNode getDefault()
SwitchFoldablegetDefault in interface SwitchFoldablepublic ValueNode switchValue()
SwitchFoldableswitchValue in interface SwitchFoldablepublic boolean isNonInitializedProfile()
SwitchFoldableisNonInitializedProfile in interface SwitchFoldablepublic ProfileData.ProfileSource profileSource()
SwitchFoldableprofileSource in interface SwitchFoldablepublic ProfileData.BranchProbabilityData getProfileData()
ControlSplitNodegetProfileData in class ControlSplitNodepublic int intKeyAt(int i)
SwitchFoldableintKeyAt in interface SwitchFoldablepublic double keyProbability(int i)
SwitchFoldablekeyProbability in interface SwitchFoldablepublic AbstractBeginNode keySuccessor(int i)
SwitchFoldablekeySuccessor in interface SwitchFoldablepublic double defaultProbability()
SwitchFoldabledefaultProbability in interface SwitchFoldablepublic static boolean sameDestination(AbstractBeginNode succ1, AbstractBeginNode succ2)
protected void removeThroughFalseBranch(SimplifierTool tool, AbstractMergeNode merge)
public static Constant[] constantValues(ValueNode node, AbstractMergeNode merge, boolean allowNull)
ConstantNode or a
PhiNode whose input values are all constants. The length of the returned array is
equal to the number of ends terminating in a given merge node.node is neither a ConstantNode nor a PhiNode whose
input values are all constantspublic AbstractBeginNode getPrimarySuccessor()
ControlSplitNodegetPrimarySuccessor in class ControlSplitNodepublic AbstractBeginNode getSuccessor(boolean result)
public boolean setProbability(AbstractBeginNode successor, ProfileData.BranchProbabilityData profileData)
ControlSplitNodeprofileData's profile source.setProbability in class ControlSplitNodepublic int getSuccessorCount()
ControlSplitNodegetSuccessorCount in class ControlSplitNode