public interface SwitchFoldable extends ValueNodeInterface
| Modifier and Type | Interface and Description |
|---|---|
static class |
SwitchFoldable.Helper |
static class |
SwitchFoldable.KeyData |
static class |
SwitchFoldable.QuickQueryKeyData |
static class |
SwitchFoldable.QuickQueryList<T>
Supports O(1) addition to the list, fast
contains and indexOf queries
(usually O(1), worst case O(n)), and O(1) random access. |
| Modifier and Type | Field and Description |
|---|---|
static Comparator<SwitchFoldable.KeyData> |
SORTER |
| Modifier and Type | Method and Description |
|---|---|
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.
|
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.
|
int |
intKeyAt(int i)
Returns the value of the i-th key of this node.
|
default boolean |
isDefaultSuccessor(AbstractBeginNode successor)
Should be overridden if getDefault() has side effects.
|
boolean |
isInSwitch(ValueNode switchValue)
Determines whether the node should be folded in the current folding attempt.
|
default boolean |
isNonInitializedProfile()
Heuristics that tries to determine whether or not a foldable node was profiled.
|
default int |
keyCount() |
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.
|
static boolean |
maybeIsInSwitch(LogicNode condition) |
ProfileData.ProfileSource |
profileSource()
Returns the source of the information about branch probabilities of this node.
|
static boolean |
sameSwitchValue(LogicNode condition,
ValueNode switchValue) |
default boolean |
switchTransformationOptimization(SimplifierTool tool)
Collapses a cascade of foldables (IfNode, FixedGuard and IntegerSwitch) into a single switch.
|
ValueNode |
switchValue()
Returns the value that will be used as the switch input.
|
asNodestatic final Comparator<SwitchFoldable.KeyData> SORTER
Node getNextSwitchFoldableBranch()
ValueNode switchValue()
AbstractBeginNode getDefault()
boolean isInSwitch(ValueNode switchValue)
switchValue - the value of the switch that will spawn through this folding attempt.SwitchFoldable.maybeIsInSwitch(LogicNode),
SwitchFoldable.sameSwitchValue(LogicNode, ValueNode)void cutOffCascadeNode()
void cutOffLowestCascadeNode()
int intKeyAt(int i)
double keyProbability(int i)
AbstractBeginNode keySuccessor(int i)
double defaultProbability()
ProfileData.ProfileSource profileSource()
default int keyCount()
default boolean isDefaultSuccessor(AbstractBeginNode successor)
default boolean isNonInitializedProfile()
static boolean maybeIsInSwitch(LogicNode condition)
default boolean switchTransformationOptimization(SimplifierTool tool)