public abstract class CompareNode extends BinaryOpLogicNode implements Canonicalizable.Binary<ValueNode>
Node.ConstantNodeParameter, Node.InjectedNodeParameter, Node.Input, Node.NodeIntrinsic, Node.OptionalInput, Node.Successor, Node.ValueNumberable
Canonicalizable.Binary<T extends Node>, Canonicalizable.BinaryCommutative<T extends Node>, Canonicalizable.Unary<T extends Node>
Modifier and Type | Field and Description |
---|---|
protected Condition |
condition |
static NodeClass<CompareNode> |
TYPE |
protected boolean |
unorderedIsTrue |
x, y
NODE_LIST, NOT_ITERABLE, USE_UNSAFE_TO_CLONE, WithAllEdges, WithNoEdges, WithOnlyInputEdges, WithOnlySucessorEdges
Modifier | Constructor and Description |
---|---|
protected |
CompareNode(NodeClass<? extends CompareNode> c,
Condition condition,
boolean unorderedIsTrue,
ValueNode x,
ValueNode y)
Constructs a new Compare instruction.
|
Modifier and Type | Method and Description |
---|---|
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. |
private ConstantNode |
canonicalConvertConstant(CanonicalizerTool tool,
ConvertNode convert,
Constant constant) |
protected ValueNode |
canonicalizeSymmetricConstant(CanonicalizerTool tool,
Constant constant,
ValueNode nonConstant,
boolean mirrored) |
Condition |
condition()
Gets the condition (comparison operation) for this instruction.
|
static LogicNode |
createCompareNode(Condition condition,
ValueNode x,
ValueNode y,
ConstantReflectionProvider constantReflection) |
static LogicNode |
createCompareNode(StructuredGraph graph,
Condition condition,
ValueNode x,
ValueNode y,
ConstantReflectionProvider constantReflection) |
protected abstract LogicNode |
duplicateModified(ValueNode newX,
ValueNode newY) |
private ValueNode |
optimizeConditional(Constant constant,
ConditionalNode conditionalNode,
ConstantReflectionProvider constantReflection,
Condition cond) |
protected ValueNode |
optimizeNormalizeCmp(Constant constant,
NormalizeCompareNode normalizeNode,
boolean mirrored) |
static LogicNode |
tryConstantFold(Condition condition,
ValueNode forX,
ValueNode forY,
ConstantReflectionProvider constantReflection,
boolean unorderedIsTrue) |
boolean |
unorderedIsTrue()
Checks whether unordered inputs mean true or false (only applies to float operations).
|
generate, getSucceedingStampForX, getSucceedingStampForY, getX, getY, maybeCommuteInputs, tryFold, verify
and, and, isContradiction, isTautology, or, or
asNode
asConstant, asJavaConstant, getKind, graph, inferStamp, isAllowedUsageType, isConstant, isConstantPredicate, isNullConstant, setStamp, stamp, updateStamp
acceptInputs, acceptSuccessors, afterClone, assertFalse, assertTrue, cfgPredecessors, 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, simplify, successors, toString, toString, updatePredecessor, updateUsages, updateUsagesInterface, usages, valueEquals, verifyEdges, verifyInputs
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
canonical, getX, getY
public static final NodeClass<CompareNode> TYPE
protected final boolean unorderedIsTrue
protected CompareNode(NodeClass<? extends CompareNode> c, Condition condition, boolean unorderedIsTrue, ValueNode x, ValueNode y)
x
- the instruction producing the first input to the instructiony
- the instruction that produces the second input to this instructionpublic final Condition condition()
public final boolean unorderedIsTrue()
true
if unordered inputs produce trueprivate ValueNode optimizeConditional(Constant constant, ConditionalNode conditionalNode, ConstantReflectionProvider constantReflection, Condition cond)
protected ValueNode optimizeNormalizeCmp(Constant constant, NormalizeCompareNode normalizeNode, boolean mirrored)
public ValueNode canonical(CanonicalizerTool tool, ValueNode forX, ValueNode forY)
Canonicalizable.Binary
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.canonical
in interface Canonicalizable.Binary<ValueNode>
public static LogicNode tryConstantFold(Condition condition, ValueNode forX, ValueNode forY, ConstantReflectionProvider constantReflection, boolean unorderedIsTrue)
protected abstract LogicNode duplicateModified(ValueNode newX, ValueNode newY)
protected ValueNode canonicalizeSymmetricConstant(CanonicalizerTool tool, Constant constant, ValueNode nonConstant, boolean mirrored)
private ConstantNode canonicalConvertConstant(CanonicalizerTool tool, ConvertNode convert, Constant constant)
public static LogicNode createCompareNode(StructuredGraph graph, Condition condition, ValueNode x, ValueNode y, ConstantReflectionProvider constantReflection)
public static LogicNode createCompareNode(Condition condition, ValueNode x, ValueNode y, ConstantReflectionProvider constantReflection)