public final class BranchProbabilityNode extends FloatingNode implements Simplifiable, Lowerable, Canonicalizable
Node.ConstantNodeParameter, Node.EdgeVisitor, Node.IndirectCanonicalization, Node.InjectedNodeParameter, Node.Input, Node.NodeInsertionStackTrace, Node.NodeIntrinsic, Node.NodeIntrinsicFactory, Node.OptionalInput, Node.Successor, Node.ValueNumberable
Canonicalizable.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 double |
DEOPT_PROBABILITY |
static double |
FAST_PATH_PROBABILITY |
static double |
FREQUENT_PROBABILITY |
static double |
LIKELY_PROBABILITY |
static double |
LUDICROUSLY_FAST_PATH_PROBABILITY |
static double |
LUDICROUSLY_SLOW_PATH_PROBABILITY |
static double |
NOT_FREQUENT_PROBABILITY |
static double |
NOT_LIKELY_PROBABILITY |
static double |
SLOW_PATH_PROBABILITY |
static NodeClass<BranchProbabilityNode> |
TYPE |
static double |
VERY_FAST_PATH_PROBABILITY |
static double |
VERY_SLOW_PATH_PROBABILITY |
NODE_LIST, NOT_ITERABLE, TRACK_CREATION_POSITION, WithAllEdges, WithNoEdges, WithOnlyInputEdges, WithOnlySucessorEdges
Constructor and Description |
---|
BranchProbabilityNode(ValueNode probability,
ValueNode condition) |
Modifier and Type | Method and Description |
---|---|
Node |
canonical(CanonicalizerTool tool)
Implementations of this method can provide local optimizations like constant folding and
strength reduction.
|
ValueNode |
getCondition() |
ValueNode |
getProbability() |
void |
lower(LoweringTool tool)
Expand this node into lower level nodes expressing the same semantics.
|
static boolean |
probability(double probability,
boolean condition)
This intrinsic should only be used for the condition of an if statement.
|
void |
simplify(SimplifierTool tool)
Must be overridden by subclasses that implement
Simplifiable . |
asNode
asConstant, asJavaConstant, asSerializableConstant, getStackKind, graph, hasUsagesOtherThan, inferStamp, isAllowedUsageType, isConstant, isConstantPredicate, isDefaultConstant, isIllegalConstant, isJavaConstant, isNullConstant, isSerializableConstant, replaceAtAllUsages, replaceAtUsages, setStamp, stamp, updateStamp
afterClone, applyInputs, applySuccessors, assertFalse, assertTrue, cfgPredecessors, cfgSuccessors, clearInputs, clearNodeSourcePosition, clearSuccessors, copyWithInputs, copyWithInputs, dataFlowEquals, estimatedNodeCycles, estimatedNodeSize, fail, formatTo, getCreationPosition, getDebug, getDebugProperties, getDebugProperties, getInsertionPosition, getNodeClass, getNodeSourcePosition, getOptions, getUsageCount, hasExactlyOneUsage, hashCode, hasMoreThanOneUsage, hasNoUsages, hasOnlyUsagesOfType, hasUsages, inputPositions, inputs, isAlive, isDeleted, isUnregistered, markDeleted, maybeNotifyZeroUsages, modCount, predecessor, pushInputs, removeUsage, replaceAllInputs, replaceAndDelete, replaceAtMatchingUsages, replaceAtPredecessor, replaceAtUsages, replaceAtUsages, replaceAtUsages, replaceAtUsages, replaceAtUsagesAndDelete, replaceAtUsagesAndDelete, replaceFirstInput, replaceFirstInput, replaceFirstSuccessor, safeDelete, setCreationPosition, setInsertionPosition, setNodeSourcePosition, successorPositions, successors, toString, toString, updateNodeSourcePosition, updatePredecessor, updateUsages, updateUsagesInterface, usages, valueEquals, verify, verifyEdges, verifyInputs, verifySourcePosition, withNodeSourcePosition
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
asNode
public static final NodeClass<BranchProbabilityNode> TYPE
public static final double LIKELY_PROBABILITY
public static final double NOT_LIKELY_PROBABILITY
public static final double FREQUENT_PROBABILITY
public static final double NOT_FREQUENT_PROBABILITY
public static final double FAST_PATH_PROBABILITY
public static final double SLOW_PATH_PROBABILITY
public static final double VERY_FAST_PATH_PROBABILITY
public static final double VERY_SLOW_PATH_PROBABILITY
public static final double DEOPT_PROBABILITY
public static final double LUDICROUSLY_FAST_PATH_PROBABILITY
public static final double LUDICROUSLY_SLOW_PATH_PROBABILITY
public ValueNode getProbability()
public ValueNode getCondition()
public Node canonical(CanonicalizerTool tool)
Canonicalizable
null
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 Canonicalizable
tool
- provides access to runtime interfaces like MetaAccessProvider
public void simplify(SimplifierTool tool)
Node
Simplifiable
. The implementation in
Node
exists to obviate the need to cast a node before invoking
Simplifiable.simplify(SimplifierTool)
.simplify
in interface Simplifiable
simplify
in class Node
public static boolean probability(double probability, boolean condition)
probability
- the probability that the given condition is true as a double value between
0.0 and 1.0.condition
- the simple condition without any && or || operatorspublic void lower(LoweringTool tool)
Lowerable