ControlFlowGraph class

Represents a control flow graph operating on basic blocks of SSA operations.

Constructors

ControlFlowGraph()
Creates a new control flow graph.

Properties

allLiveIn Map<int, Set<SSA>>
no setter
allLiveOut Map<int, Set<SSA>>
no setter
blockDefines Map<int, Set<SSA>>?
Specifies all SSA variables defined in each block. Only available after converting to SSA form.
getter/setter pair
defines Map<SSA, SpecifiedOperation>?
getter/setter pair
djGraph → Graph<int, int>
Get computed DJ-graph of the control flow graph. The DJ-graph is a directed graph with D-edges, which link immediate dominators to their children, and J-edges, representing jumps in the control flow between blocks that are not immediate dominators.
no setter
dominators Map<int, int>
Get the immediate dominators of each block in the control flow graph. The root block has itself as the dominator.
no setter
dominatorTree → Graph<int, void>
Get the dominator tree of the control flow graph. The dominator tree is a tree where each node is the immediate dominator of its children.
no setter
globals Map<String, Set<int>>
Get computed globals in the control flow graph. Globals are all variables that are written to in one block and read from in another.
no setter
graph → Graph<int, void>
The underlying directed graph structure. If you modify this graph directly, you must call invalidate to reset the internal caches.
final
hashCode int
The hash code for this object.
no setterinherited
hasPhiNodes bool
Whether the control flow graph has had Phi nodes inserted (by calling insertPhiNodes).
no setter
inSSAForm bool
Whether the control flow graph is in SSA form (after calling computeSemiPrunedSSA).
no setter
labels Map<String, int>
Map of labels to block IDs
final
lastBlockId int
Last block ID assigned
getter/setter pair
loops Set<Loop>
Loops
final
maxVersions Map<String, int>
Max version of each SSA variable.
getter/setter pair
mergeSets Map<int, Set<int>>
Get computed merge sets of the control flow graph. A merge set of a block is the set of all blocks where its control flow can 'merge' with a different path.
no setter
nextUseDistances Map<int, Map<SSA, SplayTreeSet<int>>>
no setter
opCreators Map<Type, InstructionCreator<Operation, dynamic>>
Op creators
final
registerPressure Map<int, Map<RegisterGroup, int>>
Get the computed register pressure for each block in the control flow graph. Only available after converting to SSA form.
no setter
regTypes Map<int, RegType>
Map of type IDs to RegTypes
final
root BasicBlock<Operation>
Root block of the control flow graph
latefinal
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
ssaGraph → Graph<SpecifiedOperation, void>
SSA graph. Only available after converting to SSA form.
no setter
uses Map<SSA, Set<SpecifiedOperation>>?
Uses of each SSA variable in the control flow graph. Only available after converting to SSA form.
getter/setter pair

Methods

append(BasicBlock<Operation> block, [bool override = false]) → void
Append a block without linking it to any other block.
assembleToInstructions<C>(AssemblerConfig<C> config) Map<int, List<Instruction>>
Assembles the post-register-allocation IR into concrete Instruction lists, one per basic block, keyed by block ID.
computeSemiPrunedSSA() → void
Convert the control flow graph to semi-pruned SSA form.
convertToConventionalForm() → void
findSSAVariable(BasicBlock<Operation> block, String name) SSA
Find the current version of a variable in a block. Must be in SSA form.
insertPhiNodes() → void
Insert Phi nodes into the control flow graph. This is necessary before converting the control flow graph to SSA form.
invalidate() → void
Invalidate all internal caches. This is necessary if you modify the graph directly.
isLiveIn(SSA variable, BasicBlock<Operation> block) bool
Query live-in variable information for a block. Must be in SSA form.
isLiveOut(SSA variable, BasicBlock<Operation> block) bool
Query live-out variable information for a block. Must be in SSA form.
Link the end of source to the start of target. If the blocks are not already part of the graph, they will be added.
linkAll(Iterable<BasicBlock<Operation>> source, Iterable<BasicBlock<Operation>> target) → void
Link all blocks in source to all blocks in target. If the blocks are not already part of the graph, they will be added.
linkAllLabel(Iterable<String> source, Iterable<String> target) → void
Link all blocks with source label to all blocks with target label.
linkLabel(String source, String target) → void
Link the end of the block with source label to the start of the block with target label.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
performRegisterAllocation() → void
Assign physical registers to every SSA variable in the CFG.
printMergeSets() → void
Print the computed merge sets in a readable format.
registerRegType(int id, RegType type) → void
Register a RegType for the given type ID.
removeEmptyAndUnusedBlocks() → void
removePhiNodes(Operation assign(SSA left, SSA right)) → void
Remove Phi nodes from the control flow graph, replacing them with normal assignment operations.
removeUnusedDefines() → void
runCopyPropagation() → void
spillReloadVariables(Map<RegisterGroup, int> registerCounts) → void
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited
operator [](Object id) BasicBlock<Operation>?
Get the basic block with the given ID or label.

Static Properties

branch SSA
Magic constant. Assign a boolean value to this SSA to indicate the taking a conditional branch.
final

Static Methods

builder() → ControlFlowGraphBuilder
Create a new declarative control flow graph builder.