public abstract class PhiNode extends FloatingNode implements Canonicalizable
PhiNodes represent the merging of edges at a control flow merges (
AbstractMergeNode or LoopBeginNode). For a AbstractMergeNode, the order
of the values corresponds to the order of the ends. For LoopBeginNodes, the first value
corresponds to the loop's predecessor, while the rest of the values correspond to the
LoopEndNodes.Node.ConstantNodeParameter, Node.EdgeVisitor, Node.IndirectCanonicalization, Node.InjectedNodeParameter, Node.Input, Node.NodeInsertionStackTrace, Node.NodeIntrinsic, Node.NodeIntrinsicFactory, Node.OptionalInput, Node.Successor, Node.ValueNumberableCanonicalizable.Binary<T extends Node>, Canonicalizable.BinaryCommutative<T extends Node>, Canonicalizable.Ternary<T extends Node>, Canonicalizable.Unary<T extends Node>| Modifier and Type | Field and Description |
|---|---|
protected AbstractMergeNode |
merge |
static NodeClass<PhiNode> |
TYPE |
EMPTY_ARRAY, stampNODE_LIST, NOT_ITERABLE, TRACK_CREATION_POSITION, WithAllEdges, WithNoEdges, WithOnlyInputEdges, WithOnlySucessorEdges| Modifier | Constructor and Description |
|---|---|
protected |
PhiNode(NodeClass<? extends PhiNode> c,
Stamp stamp,
AbstractMergeNode merge) |
| Modifier and Type | Method and Description |
|---|---|
void |
addInput(ValueNode x) |
NodeIterable<ValueNode> |
backValues() |
ValueNode |
canonical(CanonicalizerTool tool)
Implementations of this method can provide local optimizations like constant folding and
strength reduction.
|
void |
clearValues() |
abstract ProxyNode |
createProxyFor(LoopExitNode lex) |
abstract PhiNode |
duplicateOn(AbstractMergeNode newMerge)
Create a phi of the same kind on the given merge.
|
ValueNode |
firstValue() |
void |
initializeValueAt(int i,
ValueNode x)
Sets the value at the given index and makes sure that the values list is large enough.
|
boolean |
isDegenerated() |
boolean |
isLoopPhi() |
AbstractMergeNode |
merge() |
void |
removeInput(int index) |
void |
setMerge(AbstractMergeNode x) |
void |
setValueAt(AbstractEndNode end,
ValueNode x) |
void |
setValueAt(int i,
ValueNode x) |
ValueNode |
singleBackValueOrThis()
If all inputs (but the first one) are the same value, that value is returned, otherwise
this. |
ValueNode |
singleValueOrThis()
If all inputs are the same value, that value is returned, otherwise
this. |
String |
toString(Verbosity verbosity)
Creates a String representation for
this with a given Verbosity. |
ValueNode |
valueAt(AbstractEndNode pred) |
ValueNode |
valueAt(int i)
Get the instruction that produces the value associated with the i'th predecessor of the
merge.
|
int |
valueCount()
Get the number of inputs to this phi (i.e.
|
protected String |
valueDescription()
String describing the kind of value this Phi merges.
|
abstract NodeInputList<ValueNode> |
values() |
boolean |
verify() |
asConstant, 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, updateNodeSourcePosition, updatePredecessor, updateUsages, usages, valueEquals, verifyEdges, verifyInputs, verifySourcePosition, withNodeSourcePositionprotected AbstractMergeNode merge
protected PhiNode(NodeClass<? extends PhiNode> c, Stamp stamp, AbstractMergeNode merge)
public abstract NodeInputList<ValueNode> values()
public AbstractMergeNode merge()
public void setMerge(AbstractMergeNode x)
public ValueNode valueAt(int i)
i - the index of the predecessorpublic void initializeValueAt(int i,
ValueNode x)
i - the index at which to set the valuex - the new phi input value for the given locationpublic void setValueAt(int i,
ValueNode x)
public void setValueAt(AbstractEndNode end, ValueNode x)
public ValueNode valueAt(AbstractEndNode pred)
public int valueCount()
public void clearValues()
public String toString(Verbosity verbosity)
Nodethis with a given Verbosity.protected String valueDescription()
PhiNode.toString(Verbosity) and
dumping.public void addInput(ValueNode x)
public void removeInput(int index)
public NodeIterable<ValueNode> backValues()
public ValueNode singleValueOrThis()
this. Note that
null is a valid return value, since GuardPhiNodes can have null
inputs.public ValueNode singleBackValueOrThis()
this. Note that null is a valid return value, since GuardPhiNodes can
have null inputs.public ValueNode canonical(CanonicalizerTool tool)
Canonicalizablenull will delete the current node and replace it with null at
all usages. Note that it is not necessary to delete floating nodes that have no more usages
this way - they will be deleted automatically.canonical in interface Canonicalizabletool - provides access to runtime interfaces like MetaAccessProviderpublic ValueNode firstValue()
public boolean isLoopPhi()
public boolean isDegenerated()
true if this node's only usages are the node itself (only possible for
loops).public abstract ProxyNode createProxyFor(LoopExitNode lex)
public abstract PhiNode duplicateOn(AbstractMergeNode newMerge)
newMerge - the merge to use for the newly created phi