|
|||||||||||
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.EstimateBlockFrequencies
public class EstimateBlockFrequencies
Derive relative basic block execution frequencies from branch probabilities.
This code assumes that the loop structure tree can be constructed for the CFG in question. This implies that the CFG is reducible.
The basic algorithm is as follows:
Field Summary | |
---|---|
private static Constructor<CompilerPhase> |
constructor
Constructor for this compiler phase |
private IR |
ir
The IR on which to operate. |
private LSTGraph |
lst
The loop structure tree of said IR |
private BasicBlock[] |
topOrder
Topological ordering (ignoring backedges) of CFG |
Fields inherited from class org.jikesrvm.compilers.opt.driver.CompilerPhase |
---|
container |
Constructor Summary | |
---|---|
EstimateBlockFrequencies()
|
Method Summary | |
---|---|
private void |
computeBlockFrequencies()
|
private void |
computeInfrequentBlocks(IR ir)
Compute which blocks are infrequent. |
private float |
computeLoopExitWeight(LSTNode n)
|
private void |
computeLoopMultipliers(LSTNode n)
Postorder traversal of LST computing loop multiplier and loop exits for each loop. |
private void |
computeMultiplier(LSTNode n)
Compute the loop multiplier for this loop nest |
private void |
computeNodeWeights(LSTNode n)
Propagate execution frequencies through the loop. |
Constructor<CompilerPhase> |
getClassConstructor()
Get a constructor object for this compiler phase |
String |
getName()
|
void |
perform(IR _ir)
Compute relative basic block frequencies for the argument IR based on the branch probability information on each conditional and multiway branch. |
private void |
processEdge(LSTNode n,
BasicBlock source,
BasicBlock target,
float prob,
float weight)
|
void |
reportAdditionalStats()
Called when printing a measure compilation report to enable a phase to report additional phase-specific statistics. |
private void |
setDumbFrequencies(IR ir)
Set the frequency of each basic block to 1.0f. |
Methods inherited from class org.jikesrvm.compilers.opt.driver.CompilerPhase |
---|
dumpIR, dumpIR, getCompilerPhaseConstructor, getCompilerPhaseConstructor, newExecution, performPhase, printingEnabled, setContainer, shouldPerform, verify |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private IR ir
private LSTGraph lst
private static final Constructor<CompilerPhase> constructor
private BasicBlock[] topOrder
Constructor Detail |
---|
public EstimateBlockFrequencies()
Method Detail |
---|
public Constructor<CompilerPhase> getClassConstructor()
getClassConstructor
in class CompilerPhase
public String getName()
getName
in class CompilerPhase
public void reportAdditionalStats()
CompilerPhase
reportAdditionalStats
in class CompilerPhase
public void perform(IR _ir)
Assumptions:
perform
in class CompilerPhase
_ir
- the IR on which to apply the phaseprivate void setDumbFrequencies(IR ir)
private void computeInfrequentBlocks(IR ir)
Algorithm:
ir
- the governing IR.private void computeLoopMultipliers(LSTNode n)
private void computeMultiplier(LSTNode n)
private void computeNodeWeights(LSTNode n)
private void processEdge(LSTNode n, BasicBlock source, BasicBlock target, float prob, float weight)
private float computeLoopExitWeight(LSTNode n)
private void computeBlockFrequencies()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |