|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jikesrvm.compilers.opt.driver.CompilerPhase org.jikesrvm.compilers.opt.controlflow.CFGTransformations
public class CFGTransformations
This Phase supports
Field Summary | |
---|---|
private static boolean |
DEBUG
|
Fields inherited from class org.jikesrvm.compilers.opt.driver.CompilerPhase |
---|
container |
Constructor Summary | |
---|---|
CFGTransformations()
|
Method Summary | |
---|---|
private static float |
edgeFrequency(BasicBlock a,
BasicBlock b)
|
private static void |
ensureLandingPad(LSTNode n,
IR ir)
|
private static void |
ensureLandingPads(IR ir)
treat all loops of the ir |
private static void |
ensureLandingPads(LSTNode t,
IR ir)
deal with a sub tree of the loop structure tree |
private static boolean |
exitsLoop(BasicBlock b,
BitVector loop)
|
String |
getName()
Returns the name of the phase. |
(package private) static boolean |
inLoop(BasicBlock b,
BitVector nloop)
|
private static BasicBlock[] |
inLoopPredecessors(LSTNode n)
the predecessors of the loop header that are part of the loop. |
private static BasicBlock[] |
inLoopSuccessors(LSTNode n)
the successors of the loop header that are part of the loop. |
(package private) static void |
killFallThroughs(IR ir,
BitVector nloop)
|
private static BasicBlock[] |
loopPredecessors(LSTNode n)
the predecessors of the loop header that are not part of the loop |
CompilerPhase |
newExecution(IR ir)
Return this instance of this phase. |
void |
perform(IR ir)
This is the method that actually does the work of the phase. |
boolean |
printingEnabled(OptOptions options,
boolean before)
Returns true if the phase wants the IR dumped before and/or after it runs. |
boolean |
shouldPerform(OptOptions options)
Should this phase be performed? |
static void |
splitCriticalEdges(IR ir)
Critical edge removal: if (a,b) is an edge in the cfg where `a' has more than one out-going edge and `b' has more than one in-coming edge, insert a new empty block `c' on the edge between `a' and `b'. |
(package private) static void |
staticPerform(IR ir)
static version of perform |
private static boolean |
turnLoopIntoUntil(LSTNode n,
IR ir)
Transform a given loop Look for the set S of in-loop predecessors of the loop header h. |
private static boolean |
turnLoopTreeIntoUntils(LSTNode t,
IR ir)
deal with a sub tree of the loop structure tree |
private static boolean |
turnWhilesIntoUntils(IR ir)
treat all loops of the ir |
Methods inherited from class org.jikesrvm.compilers.opt.driver.CompilerPhase |
---|
dumpIR, dumpIR, getClassConstructor, getCompilerPhaseConstructor, getCompilerPhaseConstructor, performPhase, reportAdditionalStats, setContainer, verify |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final boolean DEBUG
Constructor Detail |
---|
public CFGTransformations()
Method Detail |
---|
public CompilerPhase newExecution(IR ir)
newExecution
in class CompilerPhase
ir
- not used
public void perform(IR ir)
CompilerPhase
perform
in class CompilerPhase
ir
- the IR on which to apply the phasestatic void staticPerform(IR ir)
ir
- public boolean shouldPerform(OptOptions options)
shouldPerform
in class CompilerPhase
options
- the compiler options for the compilation
true
if the opt level is at least 2 and whiles should be turned into untilspublic String getName()
getName
in class CompilerPhase
public boolean printingEnabled(OptOptions options, boolean before)
true
if the phase wants the IR dumped before and/or after it runs.
printingEnabled
in class CompilerPhase
options
- the compiler options for the compilationbefore
- true when invoked before perform, false otherwise.
private static boolean turnWhilesIntoUntils(IR ir)
private static boolean turnLoopTreeIntoUntils(LSTNode t, IR ir)
private static void ensureLandingPads(IR ir)
private static void ensureLandingPads(LSTNode t, IR ir)
private static float edgeFrequency(BasicBlock a, BasicBlock b)
private static void ensureLandingPad(LSTNode n, IR ir)
private static boolean turnLoopIntoUntil(LSTNode n, IR ir)
Look for the set S of in-loop predecessors of the loop header h. Make a copy h' of the loop header and redirect all edges going from nodes in S to h. Make them point to h' instead.
As an effect of this transformation, the old header is now not anymore part of the loop, but guards it.
private static BasicBlock[] loopPredecessors(LSTNode n)
private static BasicBlock[] inLoopPredecessors(LSTNode n)
private static BasicBlock[] inLoopSuccessors(LSTNode n)
static void killFallThroughs(IR ir, BitVector nloop)
static boolean inLoop(BasicBlock b, BitVector nloop)
private static boolean exitsLoop(BasicBlock b, BitVector loop)
public static void splitCriticalEdges(IR ir)
We do this to provide landing pads for loop-invariant code motion. So we split only edges, where `a' has a lower loop nesting depth than `b'.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |