public final class ReorderingPhase extends CompilerPhase
Modifier and Type | Class and Description |
---|---|
private static class |
ReorderingPhase.ChainInfo |
private static class |
ReorderingPhase.Edge |
Modifier and Type | Field and Description |
---|---|
private static boolean |
DEBUG |
container
Constructor and Description |
---|
ReorderingPhase() |
Modifier and Type | Method and Description |
---|---|
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.
|
dumpIR, dumpIR, getClassConstructor, getCompilerPhaseConstructor, getCompilerPhaseConstructor, performPhase, reportAdditionalStats, setContainer, verify
private static final boolean DEBUG
public ReorderingPhase()
public CompilerPhase newExecution(IR ir)
newExecution
in class CompilerPhase
ir
- not usedpublic boolean shouldPerform(OptOptions options)
CompilerPhase
shouldPerform
in class CompilerPhase
options
- the compiler options for the compilationpublic 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)