Search in sources :

Example 6 with LiveAnalysis

use of org.jikesrvm.compilers.opt.liveness.LiveAnalysis in project JikesRVM by JikesRVM.

the class MIROptimizationPlanner method MIROptimizations.

/**
 * This method defines the optimization plan elements that
 * are to be performed on IA32 MIR.
 *
 * @param p the plan under construction
 */
private static void MIROptimizations(ArrayList<OptimizationPlanElement> p) {
    // Register Allocation
    composeComponents(p, "Register Mapping", new Object[] { new RewriteMemoryOperandsWithOversizedDisplacements(), new MIRSplitRanges(), // MANDATORY: Expand calling convention
    new ExpandCallingConvention(), // MANDATORY: Insert defs/uses due to floating-point stack
    new ExpandFPRStackConvention(), // MANDATORY: Perform Live analysis and create GC maps
    new LiveAnalysis(true, false), // MANDATORY: Perform register allocation
    new RegisterAllocator(), // MANDATORY: Add prologue and epilogue
    new PrologueEpilogueCreator() });
    // Peephole branch optimizations
    addComponent(p, new MIRBranchOptimizations(1));
}
Also used : RegisterAllocator(org.jikesrvm.compilers.opt.regalloc.RegisterAllocator) PrologueEpilogueCreator(org.jikesrvm.compilers.opt.regalloc.PrologueEpilogueCreator) RewriteMemoryOperandsWithOversizedDisplacements(org.jikesrvm.compilers.opt.regalloc.ia32.RewriteMemoryOperandsWithOversizedDisplacements) LiveAnalysis(org.jikesrvm.compilers.opt.liveness.LiveAnalysis) MIRBranchOptimizations(org.jikesrvm.compilers.opt.controlflow.MIRBranchOptimizations) ExpandCallingConvention(org.jikesrvm.compilers.opt.regalloc.ExpandCallingConvention) ExpandFPRStackConvention(org.jikesrvm.compilers.opt.regalloc.ia32.ExpandFPRStackConvention) MIRSplitRanges(org.jikesrvm.compilers.opt.regalloc.ia32.MIRSplitRanges)

Example 7 with LiveAnalysis

use of org.jikesrvm.compilers.opt.liveness.LiveAnalysis in project JikesRVM by JikesRVM.

the class MIROptimizationPlanner method MIROptimizations.

/**
 * This method defines the optimization plan elements that
 * are to be performed on PowerPC MIR.
 *
 * @param p the plan under construction
 */
private static void MIROptimizations(ArrayList<OptimizationPlanElement> p) {
    // //////////////////
    // MIR OPTS(1) (before register allocation)
    // //////////////////
    // currently nothing to do
    // //////////////////
    // GCMapping part1 and RegisterAllocation
    // //////////////////
    composeComponents(p, "Register Mapping", new Object[] { // MANDATORY: Expand calling convention
    new ExpandCallingConvention(), // MANDATORY: Perform Live analysis and create GC maps
    new LiveAnalysis(true, false), // MANDATORY: Perform register allocation
    new RegisterAllocator(), // MANDATORY: Add prologue and epilogue
    new PrologueEpilogueCreator() });
    // //////////////////
    // MIR OPTS(2) (after register allocation)
    // NOTE: GCMapping part 1 has created the GC maps already.
    // From now until the end of compilation, we cannot change
    // the set of live references at a GC point
    // without updating the GCMaps.
    // Effectively this means that we can only do the
    // most trivial optimizations from
    // here on out without having to some potentially complex bookkeeping.
    // //////////////////
    // Peephole branch optimizations
    addComponent(p, new MIRBranchOptimizations(1));
}
Also used : RegisterAllocator(org.jikesrvm.compilers.opt.regalloc.RegisterAllocator) PrologueEpilogueCreator(org.jikesrvm.compilers.opt.regalloc.PrologueEpilogueCreator) LiveAnalysis(org.jikesrvm.compilers.opt.liveness.LiveAnalysis) MIRBranchOptimizations(org.jikesrvm.compilers.opt.controlflow.MIRBranchOptimizations) ExpandCallingConvention(org.jikesrvm.compilers.opt.regalloc.ExpandCallingConvention)

Aggregations

LiveAnalysis (org.jikesrvm.compilers.opt.liveness.LiveAnalysis)7 BasicBlock (org.jikesrvm.compilers.opt.ir.BasicBlock)4 Instruction (org.jikesrvm.compilers.opt.ir.Instruction)3 HashSet (java.util.HashSet)2 MIRBranchOptimizations (org.jikesrvm.compilers.opt.controlflow.MIRBranchOptimizations)2 Register (org.jikesrvm.compilers.opt.ir.Register)2 Operand (org.jikesrvm.compilers.opt.ir.operand.Operand)2 ExpandCallingConvention (org.jikesrvm.compilers.opt.regalloc.ExpandCallingConvention)2 PrologueEpilogueCreator (org.jikesrvm.compilers.opt.regalloc.PrologueEpilogueCreator)2 RegisterAllocator (org.jikesrvm.compilers.opt.regalloc.RegisterAllocator)2 HashMap (java.util.HashMap)1 LinkedList (java.util.LinkedList)1 TypeReference (org.jikesrvm.classloader.TypeReference)1 OptimizingCompilerException (org.jikesrvm.compilers.opt.OptimizingCompilerException)1 DominatorTree (org.jikesrvm.compilers.opt.controlflow.DominatorTree)1 DominatorTreeNode (org.jikesrvm.compilers.opt.controlflow.DominatorTreeNode)1 ExceptionHandlerBasicBlock (org.jikesrvm.compilers.opt.ir.ExceptionHandlerBasicBlock)1 ConstantOperand (org.jikesrvm.compilers.opt.ir.operand.ConstantOperand)1 RegisterOperand (org.jikesrvm.compilers.opt.ir.operand.RegisterOperand)1 TrueGuardOperand (org.jikesrvm.compilers.opt.ir.operand.TrueGuardOperand)1