|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jikesrvm.compilers.opt.controlflow.Dominators
public class Dominators
Calculate dominators for basic blocks.
Uses the algorithm contained in Dragon book, pg. 670-1.
D(n0) := { n0 } for n in N - { n0 } do D(n) := N; while changes to any D(n) occur do for n in N - {n0} do D(n) := {n} U (intersect of D(p) over all predecessors p of n)
TODO: we do not support IRs with exception handlers!!
Field Summary | |
---|---|
(package private) static boolean |
COMPUTE_POST_DOMINATORS
Should we compute post-dominators instead of dominators? |
(package private) static boolean |
DEBUG
Control for debug output |
Constructor Summary | |
---|---|
Dominators()
|
Method Summary | |
---|---|
static void |
computeApproxDominators(IR ir)
Calculate the "approximate" dominators for an IR i.e., the dominators in the factored CFG rather than the normal CFG. |
static void |
computeApproxPostdominators(IR ir)
Calculate the postdominators for an IR. |
static void |
perform(IR ir)
Calculate the dominators for an IR. |
static void |
printDominators(IR ir)
Print the (already calculated) dominators. |
static void |
updateBlocks(DF_Solution solution)
For each basic block in the data flow system solution, create an DominatorInfo and store it in the basic
blocks scratchObject |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
static final boolean DEBUG
static boolean COMPUTE_POST_DOMINATORS
Constructor Detail |
---|
public Dominators()
Method Detail |
---|
public static void perform(IR ir)
After this pass, each basic block's scrach field points to
an DominatorInfo
object, which holds the dominators
of the basic block.
ir
- the IR in questionpublic static void computeApproxDominators(IR ir)
(No exception is thrown if the input IR has handler blocks.)
After this pass, each basic block's scratch field points to an DominatorInfo object, which holds the dominators of the basic block.
ir
- the IR in questionpublic static void computeApproxPostdominators(IR ir)
After this pass, each basic block's scrach field points to an DominatorInfo object, which holds the postdominators of the basic block.
ir
- the IR in questionpublic static void updateBlocks(DF_Solution solution)
DominatorInfo
and store it in the basic
blocks scratchObject
solution
- the solution to the Dominators equationspublic static void printDominators(IR ir)
ir
- the IR
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |