public abstract class BinaryArithmeticNode<OP> extends BinaryNode implements ArithmeticOperation, ArithmeticLIRLowerable, Canonicalizable.Binary<ValueNode>
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 |
|---|---|
static NodeClass<BinaryArithmeticNode> |
TYPE |
x, yEMPTY_ARRAY, stampNODE_LIST, NOT_ITERABLE, TRACK_CREATION_POSITION, WithAllEdges, WithNoEdges, WithOnlyInputEdges, WithOnlySucessorEdges| Modifier | Constructor and Description |
|---|---|
protected |
BinaryArithmeticNode(NodeClass<? extends BinaryArithmeticNode<OP>> c,
ArithmeticOpTable.BinaryOp<OP> opForStampComputation,
ValueNode x,
ValueNode y) |
protected |
BinaryArithmeticNode(NodeClass<? extends BinaryArithmeticNode<OP>> c,
Stamp stamp,
ValueNode x,
ValueNode y) |
| Modifier and Type | Method and Description |
|---|---|
static ValueNode |
add(StructuredGraph graph,
ValueNode v1,
ValueNode v2,
NodeView view) |
static ValueNode |
add(ValueNode v1,
ValueNode v2) |
static ValueNode |
add(ValueNode v1,
ValueNode v2,
NodeView view) |
static ValueNode |
branchlessMax(ValueNode v1,
ValueNode v2,
NodeView view) |
static ValueNode |
branchlessMin(ValueNode v1,
ValueNode v2,
NodeView view) |
ValueNode |
canonical(CanonicalizerTool tool,
ValueNode forX,
ValueNode forY)
Similar to
Canonicalizable.canonical(CanonicalizerTool), except that
implementations should act as if the current input of the node was the given one, i.e.,
they should never look at the inputs via the this pointer. |
Stamp |
foldStamp(Stamp stampX,
Stamp stampY)
Compute an improved for this node using the passed in stamps.
|
ArithmeticOpTable.BinaryOp<OP> |
getArithmeticOp() |
static ArithmeticOpTable |
getArithmeticOpTable(ValueNode forValue) |
protected abstract ArithmeticOpTable.BinaryOp<OP> |
getOp(ArithmeticOpTable table) |
protected ArithmeticOpTable.BinaryOp<OP> |
getOp(ValueNode forX,
ValueNode forY) |
boolean |
isAssociative() |
BinaryNode |
maybeCommuteInputs()
Ensure a canonical ordering of inputs for commutative nodes to improve GVN results.
|
static ValueNode |
mul(StructuredGraph graph,
ValueNode v1,
ValueNode v2,
NodeView view) |
static ValueNode |
mul(ValueNode v1,
ValueNode v2) |
static ValueNode |
mul(ValueNode v1,
ValueNode v2,
NodeView view) |
static ValueNode |
reassociateMatchedValues(BinaryArithmeticNode<?> node,
NodePredicate criterion,
ValueNode forX,
ValueNode forY,
NodeView view)
Tries to re-associate values which satisfy the criterion.
|
static ValueNode |
reassociateUnmatchedValues(BinaryArithmeticNode<?> node,
NodePredicate criterion,
NodeView view)
Tries to push down values which satisfy the criterion.
|
protected boolean |
shouldSwapInputs(NodeValueMap nodeValueMap)
Determines if it would be better to swap the inputs in order to produce better assembly code.
|
static ValueNode |
sub(StructuredGraph graph,
ValueNode v1,
ValueNode v2,
NodeView view) |
static ValueNode |
sub(ValueNode v1,
ValueNode v2) |
static ValueNode |
sub(ValueNode v1,
ValueNode v2,
NodeView view) |
static <OP> ConstantNode |
tryConstantFold(ArithmeticOpTable.BinaryOp<OP> op,
ValueNode forX,
ValueNode forY,
Stamp stamp,
NodeView view) |
getX, getY, inferStamp, setX, setYasConstant, asJavaConstant, asNode, asSerializableConstant, checkReplaceAtUsagesInvariants, getStackKind, graph, hasUsagesOtherThan, 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, verify, verifyEdges, verifyInputs, verifySourcePosition, withNodeSourcePositionclone, equals, getClass, notify, notifyAll, wait, wait, waitgenerate, generatecanonical, getX, getYpublic static final NodeClass<BinaryArithmeticNode> TYPE
protected BinaryArithmeticNode(NodeClass<? extends BinaryArithmeticNode<OP>> c, ArithmeticOpTable.BinaryOp<OP> opForStampComputation, ValueNode x, ValueNode y)
public static ArithmeticOpTable getArithmeticOpTable(ValueNode forValue)
protected abstract ArithmeticOpTable.BinaryOp<OP> getOp(ArithmeticOpTable table)
protected final ArithmeticOpTable.BinaryOp<OP> getOp(ValueNode forX, ValueNode forY)
public final ArithmeticOpTable.BinaryOp<OP> getArithmeticOp()
getArithmeticOp in interface ArithmeticOperationpublic boolean isAssociative()
public ValueNode canonical(CanonicalizerTool tool, ValueNode forX, ValueNode forY)
Canonicalizable.BinaryCanonicalizable.canonical(CanonicalizerTool), except that
implementations should act as if the current input of the node was the given one, i.e.,
they should never look at the inputs via the this pointer.canonical in interface Canonicalizable.Binary<ValueNode>public static <OP> ConstantNode tryConstantFold(ArithmeticOpTable.BinaryOp<OP> op, ValueNode forX, ValueNode forY, Stamp stamp, NodeView view)
public Stamp foldStamp(Stamp stampX, Stamp stampY)
BinaryNodeBinaryNode.x and BinaryNode.y. This code is used to provide the
default implementation of BinaryNode.inferStamp() and may be used by external optimizations.foldStamp in class BinaryNodepublic static ValueNode add(StructuredGraph graph, ValueNode v1, ValueNode v2, NodeView view)
public static ValueNode mul(StructuredGraph graph, ValueNode v1, ValueNode v2, NodeView view)
public static ValueNode sub(StructuredGraph graph, ValueNode v1, ValueNode v2, NodeView view)
public static ValueNode reassociateUnmatchedValues(BinaryArithmeticNode<?> node, NodePredicate criterion, NodeView view)
(a * 2) * b => (a * b) * 2
This method accepts only associative operations such as
+, -, *, &, | and ^public static ValueNode reassociateMatchedValues(BinaryArithmeticNode<?> node, NodePredicate criterion, ValueNode forX, ValueNode forY, NodeView view)
(a + 2) + 1 => a + (1 + 2)
This method accepts only associative operations such as +, -, *, &, |, ^, min, max
forY - forX - public BinaryNode maybeCommuteInputs()
Node.id and call Graph.findDuplicate(Node) on the node
if it's currently in a graph. It's assumed that if there was a constant on the left it's been
moved to the right by other code and that ordering is left alone.protected boolean shouldSwapInputs(NodeValueMap nodeValueMap)
nodeValueMap -