use of org.jikesrvm.compilers.opt.controlflow.CFGTransformations in project JikesRVM by JikesRVM.
the class OptimizationPlanner method HIROptimizations.
/**
* This method defines the optimization plan elements that
* are to be performed on the HIR.
*
* @param p the plan under construction
*/
private static void HIROptimizations(ArrayList<OptimizationPlanElement> p) {
// Various large-scale CFG transformations.
// Do these very early in the pipe so that all HIR opts can benefit.
composeComponents(p, "CFG Transformations", new Object[] { // tail recursion elimination
new TailRecursionElimination(), // Assumption: none of these are active at O0.
new OptimizationPlanCompositeElement("Basic Block Frequency Estimation", new Object[] { new BuildLST(), new EstimateBlockFrequencies() }) {
@Override
public boolean shouldPerform(OptOptions options) {
return options.getOptLevel() >= 1;
}
}, // CFG splitting
new StaticSplitting(), // restructure loops
new CFGTransformations(), // Loop unrolling
new LoopUnrolling(), new BranchOptimizations(1, true, true) });
// Use the LST to insert yieldpoints and estimate
// basic block frequency from branch probabilities
composeComponents(p, "CFG Structural Analysis", new Object[] { new BuildLST(), new YieldPoints(), new EstimateBlockFrequencies() });
// Simple flow-insensitive optimizations
addComponent(p, new Simple(1, true, true, false, false));
// Simple escape analysis and related transformations
addComponent(p, new EscapeTransformations());
// Perform peephole branch optimizations to clean-up before SSA stuff
addComponent(p, new BranchOptimizations(1, true, true));
// SSA meta-phase
SSAinHIR(p);
// Perform local copy propagation for a factored basic block.
addComponent(p, new LocalCopyProp());
// Perform local constant propagation for a factored basic block.
addComponent(p, new LocalConstantProp());
// Perform local common-subexpression elimination for a
// factored basic block.
addComponent(p, new LocalCSE(true));
// Flow-insensitive field analysis
addComponent(p, new FieldAnalysis());
if (VM.BuildForAdaptiveSystem) {
// Insert counter on each method prologue
// Insert yieldpoint counters
addComponent(p, new InsertYieldpointCounters());
// Insert counter on each HIR instruction
addComponent(p, new InsertInstructionCounters());
// Insert method invocation counters
addComponent(p, new InsertMethodInvocationCounter());
}
}
Aggregations