|
|||||||||||
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.ReorderingPhase
public final class ReorderingPhase
Reorder code layout of basic blocks for improved I-cache locality and branch prediction. This code assumes that basic block frequencies have been computed and blocks have been marked infrequent. This pass actually implements two code placement algorithms:
Nested Class Summary | |
---|---|
private static class |
ReorderingPhase.ChainInfo
|
private static class |
ReorderingPhase.Edge
|
Field Summary | |
---|---|
private static boolean |
DEBUG
|
Fields inherited from class org.jikesrvm.compilers.opt.driver.CompilerPhase |
---|
container |
Constructor Summary | |
---|---|
ReorderingPhase()
|
Method Summary | |
---|---|
private void |
doPettisHansenAlgo2(IR ir)
Reorder code using Algo2 (Bottom-Up Positioning) from Pettis and Hansen PLDI'90. |
private void |
dumpChain(BasicBlock head)
|
private void |
exileInfrequentBlocks(IR ir)
Select a new basic block ordering via a simple heuristic that moves all infrequent basic blocks to the end. |
String |
getName()
|
CompilerPhase |
newExecution(IR ir)
Return this instance of this phase. |
void |
perform(IR ir)
Reorder basic blocks either by trivially moving infrequent blocks to the end of the code order or by applying Pettis and Hansen Algo2. |
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)
This method determines if the phase should be run, based on the Options object it is passed. |
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 ReorderingPhase()
Method Detail |
---|
public CompilerPhase newExecution(IR ir)
newExecution
in class CompilerPhase
ir
- not used
public boolean shouldPerform(OptOptions options)
CompilerPhase
shouldPerform
in class CompilerPhase
options
- the compiler options for the compilation
public boolean printingEnabled(OptOptions options, boolean before)
CompilerPhase
printingEnabled
in class CompilerPhase
options
- the compiler options for the compilationbefore
- true when invoked before perform, false otherwise.
public String getName()
getName
in class CompilerPhase
public void perform(IR ir)
perform
in class CompilerPhase
ir
- the IR on which to apply the phaseprivate void exileInfrequentBlocks(IR ir)
ir
- the IR object to reorderprivate void doPettisHansenAlgo2(IR ir)
ir
- the IR to reorder.private void dumpChain(BasicBlock head)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |