public final class ControlFlowGraph extends Object implements AbstractControlFlowGraph<Block>
Modifier and Type | Class and Description |
---|---|
static class |
ControlFlowGraph.CFGOptions |
static class |
ControlFlowGraph.DeferredExit |
static interface |
ControlFlowGraph.RecursiveVisitor<V> |
Modifier and Type | Field and Description |
---|---|
StructuredGraph |
graph |
static double |
MAX_RELATIVE_FREQUENCY |
static double |
MIN_RELATIVE_FREQUENCY
Don't allow relative frequency values to be become too small or too high as this makes
frequency calculations over- or underflow the range of a double.
|
BLOCK_ID_INITIAL, BLOCK_ID_VISITED
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
commonDominator, commonDominatorHelper, commonDominatorTyped, dominates, strictlyDominates
public static final double MIN_RELATIVE_FREQUENCY
public static final double MAX_RELATIVE_FREQUENCY
public final StructuredGraph graph
public static ControlFlowGraph computeForSchedule(StructuredGraph graph)
public static ControlFlowGraph compute(StructuredGraph graph, boolean connectBlocks, boolean computeLoops, boolean computeDominators, boolean computePostdominators)
public double localLoopFrequency(LoopBeginNode lb)
public ProfileData.ProfileSource localLoopFrequencySource(LoopBeginNode lb)
public org.graalvm.collections.EconomicMap<LoopBeginNode,ProfileData.LoopFrequencyData> getLocalLoopFrequencyData()
public void updateCachedLocalLoopFrequency(LoopBeginNode lb, Function<ProfileData.LoopFrequencyData,ProfileData.LoopFrequencyData> updater)
ControlFlowGraph.localLoopFrequency(LoopBeginNode)
on this ControlFlowGraph
instance
will return the updated value. This is useful for phases to record temporary effects of
transformations on loop frequencies, without having to recompute a CFG.
The updated frequency is a cached value local to this CFG. It is not persisted in
the IR graph. Newly computed ControlFlowGraph
instances will recompute a frequency
from loop exit probabilities, they will not see this locally cached value. Persistent changes
to loop frequencies must be modeled by changing loop exit probabilities in the graph.public String dominatorTreeString()
public <V> void visitDominatorTreeDefault(ControlFlowGraph.RecursiveVisitor<V> visitor)
public static void addDeferredExit(ControlFlowGraph.DeferredExit[] deferredExits, Block b)
public <V> void visitDominatorTreeDeferLoopExits(ControlFlowGraph.RecursiveVisitor<V> visitor)
public <V> void visitDominatorTree(ControlFlowGraph.RecursiveVisitor<V> visitor, boolean deferLoopExits)
public static boolean isDominatorTreeLoopExit(Block b)
public static boolean isDominatorTreeLoopExit(Block b, boolean considerRealExits)
public Block[] getBlocks()
AbstractControlFlowGraph
getBlocks
in interface AbstractControlFlowGraph<Block>
CFGVerifier
public Block getStartBlock()
getStartBlock
in interface AbstractControlFlowGraph<Block>
public Block[] reversePostOrder()
public Block commonDominatorFor(NodeIterable<? extends Node> nodes)
public List<Loop<Block>> getLoops()
getLoops
in interface AbstractControlFlowGraph<Block>
public int getMaxDominatorDepth()
public void computePostdominators()
public static double multiplyRelativeFrequencies(double a, double b, double c)
public static double multiplyRelativeFrequencies(double a, double b)
ControlFlowGraph.MIN_RELATIVE_FREQUENCY
and
ControlFlowGraph.MAX_RELATIVE_FREQUENCY
.