|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jikesrvm.compilers.opt.lir2mir.BURS org.jikesrvm.compilers.opt.lir2mir.NormalBURS
final class NormalBURS
This class contains methods for invoking BURS tree-pattern matching from the OPT Compiler. BURS is invoked on trees obtained from the dependence graph of a basic block.
DepGraph
,
ArchitectureSpecificOpt.BURS_STATE
,
ArchitectureSpecificOpt.BURS_TreeNode
Field Summary | |
---|---|
private ArchitectureSpecificOpt.BURS_TreeNode[] |
heap
A priority queue of ready tree nodes. |
private int |
numElements
|
private int |
numProblemEdges
|
private int |
numTreeRoots
|
private SpaceEffGraphEdge[] |
problemEdges
|
private ArchitectureSpecificOpt.BURS_TreeNode[] |
treeRoots
Set of all tree roots. |
Fields inherited from class org.jikesrvm.compilers.opt.lir2mir.BURS |
---|
AddressConstant, BranchTarget, DEBUG, ir, lastInstr, LongConstant, NullTreeNode, Register |
Constructor Summary | |
---|---|
NormalBURS(IR ir)
Create a BURS object for the given IR. |
Method Summary | |
---|---|
private void |
buildTrees(DepGraph dg)
Stage 1: Complete the expression trees and identify tree roots. |
private void |
generateTree(ArchitectureSpecificOpt.BURS_TreeNode k,
ArchitectureSpecificOpt.BURS_STATE burs)
|
private void |
generateTrees(ArchitectureSpecificOpt.BURS_STATE burs)
Stage 4: Visit the tree roots in topological order and emit MIR instructions by calling BURS_STATE.code on each supernode in the tree. |
private void |
handleProblemEdges()
Stage 1c: Mark src node of some problem edges as tree roots to avoid cyclic dependencies. |
private boolean |
haveProblemEdges()
|
private void |
heapify(int p)
|
private void |
initTreeRootNode(ArchitectureSpecificOpt.BURS_TreeNode t,
SpaceEffGraphNode treeRoot)
Initialize nextSorted for nodes in tree rooted at t i.e. |
void |
invoke(DepGraph dg)
Build BURS trees for dependence graph dg, label the trees, and then generate MIR instructions based on the labeling. |
private void |
labelTrees(ArchitectureSpecificOpt.BURS_STATE burs)
Stage 3: Label the trees with their min cost cover. |
private void |
makeTreeRoot(ArchitectureSpecificOpt.BURS_TreeNode n)
|
private boolean |
mustBeTreeRoot(DepGraphNode n)
Return true if node n must be a root of a BURS tree
based only on its register true dependencies. |
private void |
orderTrees(DepGraph dg)
Stage 2: Construct topological ordering of tree roots based on the dependencies between nodes in the tree. |
private void |
problemEdgePrep()
Stage 1b: Do bookkeeping to make it easier to identify harmless problem edges. |
private void |
problemEdgePrep(ArchitectureSpecificOpt.BURS_TreeNode n,
SpaceEffGraphNode root)
|
private boolean |
reachableChild(ArchitectureSpecificOpt.BURS_TreeNode n,
SpaceEffGraphNode goal,
int searchnum)
|
private boolean |
reachableRoot(SpaceEffGraphNode current,
SpaceEffGraphNode goal,
int searchnum)
|
private void |
readySetInsert(ArchitectureSpecificOpt.BURS_TreeNode node)
Add a node to the ready set. |
private boolean |
readySetNotEmpty()
Are there nodes to process on the stack? |
private ArchitectureSpecificOpt.BURS_TreeNode |
readySetRemove()
Remove a node from the ready set |
private SpaceEffGraphNode |
regTrueParent(SpaceEffGraphNode n)
|
(package private) void |
rememberAsProblemEdge(SpaceEffGraphEdge e)
|
private void |
swap(int x,
int y)
|
private boolean |
trueEdgeRedundant(SpaceEffGraphNode current,
SpaceEffGraphNode goal,
SpaceEffGraphNode root)
|
Methods inherited from class org.jikesrvm.compilers.opt.lir2mir.BURS |
---|
append, finalizeBlock, prepareForBlock |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private int numTreeRoots
private ArchitectureSpecificOpt.BURS_TreeNode[] treeRoots
private ArchitectureSpecificOpt.BURS_TreeNode[] heap
private int numElements
private SpaceEffGraphEdge[] problemEdges
private int numProblemEdges
Constructor Detail |
---|
NormalBURS(IR ir)
ir
- the IR to translate from LIR to MIR.Method Detail |
---|
public void invoke(DepGraph dg)
dg
- the dependence graph.private void buildTrees(DepGraph dg)
dg
- The dependence graph.private void problemEdgePrep()
private void problemEdgePrep(ArchitectureSpecificOpt.BURS_TreeNode n, SpaceEffGraphNode root)
private void handleProblemEdges()
private boolean trueEdgeRedundant(SpaceEffGraphNode current, SpaceEffGraphNode goal, SpaceEffGraphNode root)
private boolean reachableRoot(SpaceEffGraphNode current, SpaceEffGraphNode goal, int searchnum)
private boolean reachableChild(ArchitectureSpecificOpt.BURS_TreeNode n, SpaceEffGraphNode goal, int searchnum)
private void orderTrees(DepGraph dg)
dg
- The dependence graph.private void labelTrees(ArchitectureSpecificOpt.BURS_STATE burs)
burs
- the BURS_STATE object.private void generateTrees(ArchitectureSpecificOpt.BURS_STATE burs)
burs
- the BURS_STATE object.private void generateTree(ArchitectureSpecificOpt.BURS_TreeNode k, ArchitectureSpecificOpt.BURS_STATE burs)
private boolean mustBeTreeRoot(DepGraphNode n)
true
if node n must be a root of a BURS tree
based only on its register true dependencies.
If the node might later have to be marked as a tree
root, then include in a set of problem nodes.
n
- the dep graph node in question.private SpaceEffGraphNode regTrueParent(SpaceEffGraphNode n)
private void initTreeRootNode(ArchitectureSpecificOpt.BURS_TreeNode t, SpaceEffGraphNode treeRoot)
private void makeTreeRoot(ArchitectureSpecificOpt.BURS_TreeNode n)
private void readySetInsert(ArchitectureSpecificOpt.BURS_TreeNode node)
private boolean readySetNotEmpty()
private ArchitectureSpecificOpt.BURS_TreeNode readySetRemove()
private void heapify(int p)
private void swap(int x, int y)
void rememberAsProblemEdge(SpaceEffGraphEdge e)
private boolean haveProblemEdges()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |