public class DominanceFrontier extends CompilerPhase
Uses the algorithm of Cytron et al., TOPLAS Oct. 91:
for each X in a bottom-up traversal of the dominator tree do
DF(X) < - null
for each Y in Succ(X) do
if (idom(Y)!=X) then DF(X) <- DF(X) U Y
end
for each Z in {idom(z) = X} do
for each Y in DF(Z) do
if (idom(Y)!=X) then DF(X) <- DF(X) U Y
end
end
TODO: we do not support IRs with exception handlers!!
container| Constructor and Description |
|---|
DominanceFrontier() |
| Modifier and Type | Method and Description |
|---|---|
static BitVector |
getDominanceFrontier(IR ir,
BitVector bits)
Calculate the dominance frontier for the set of basic blocks
represented by a BitVector.
|
static BitVector |
getIteratedDominanceFrontier(IR ir,
BitVector S)
Calculate the iterated dominance frontier for a set of basic blocks
represented by a BitVector.
|
String |
getName()
Return a String representation for this phase
|
CompilerPhase |
newExecution(IR ir)
Return this instance of this phase.
|
void |
perform(IR ir)
Calculate the dominance frontier for each basic block in the
CFG.
|
boolean |
printingEnabled(OptOptions options,
boolean before)
Should the IR be printed either before or after performing this phase?
|
boolean |
shouldPerform(OptOptions options)
Should this phase be performed?
|
dumpIR, dumpIR, getClassConstructor, getCompilerPhaseConstructor, getCompilerPhaseConstructor, performPhase, reportAdditionalStats, setContainer, verifypublic DominanceFrontier()
public final boolean shouldPerform(OptOptions options)
true. The parent composite phase will
dictate.shouldPerform in class CompilerPhaseoptions - controlling compiler optionstruepublic CompilerPhase newExecution(IR ir)
newExecution in class CompilerPhaseir - not usedpublic final String getName()
getName in class CompilerPhasepublic final boolean printingEnabled(OptOptions options, boolean before)
printingEnabled in class CompilerPhaseoptions - controlling compiler optionsbefore - true iff querying before the phasefalsepublic void perform(IR ir)
NOTE: The dominator tree MUST be calculated BEFORE calling this routine.
perform in class CompilerPhaseir - the governing IRpublic static BitVector getDominanceFrontier(IR ir, BitVector bits)
NOTE: The dominance frontiers for the IR MUST be calculated BEFORE calling this routine.
ir - the governing IRbits - the BitVector representing the set of basic blockspublic static BitVector getIteratedDominanceFrontier(IR ir, BitVector S)
NOTE: The dominance frontiers for the IR MUST be calculated BEFORE calling this routine.