org.jikesrvm.compilers.opt.ssa
Class GCP

java.lang.Object
  extended by org.jikesrvm.compilers.opt.driver.OptimizationPlanElement
      extended by org.jikesrvm.compilers.opt.driver.OptimizationPlanCompositeElement
          extended by org.jikesrvm.compilers.opt.ssa.GCP

public final class GCP
extends OptimizationPlanCompositeElement

Global code placement comes in two flavours. The first is loop invariant code motion (LICM), the second is global common sub expression elimination (GCSE).

LICM is applied to HIR and LIR, GCSE only to LIR and before LICM.

Both algorithms run on SSA and use the dominator tree to determine positions for operations. That's why these operations are called code placement instead of code motion.

There is no code yet to deal with partial redundancies.


Nested Class Summary
private static class GCP.GCPFinalization
          This class sets up the IR state prior to entering SSA for GCP
private static class GCP.GCPPreparation
          This class sets up the IR state prior to entering SSA for GCP
 
Constructor Summary
GCP()
          Makes sure we are in SSA and have global value numbers at hand.
 
Method Summary
 boolean shouldPerform(OptOptions options)
          Redefine shouldPerform so that none of the subphases will occur unless we pass through this test.
(package private) static boolean tooBig(IR ir)
           
static boolean usesOrDefsPhysicalRegisterOrAddressType(Instruction inst)
           
 
Methods inherited from class org.jikesrvm.compilers.opt.driver.OptimizationPlanCompositeElement
compose, elapsedTime, getName, initializeForMeasureCompilation, perform, printingEnabled, reportStats
 
Methods inherited from class org.jikesrvm.compilers.opt.driver.OptimizationPlanElement
prettyPrintTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GCP

public GCP()
Makes sure we are in SSA and have global value numbers at hand. Then execute the transformations.

Method Detail

shouldPerform

public boolean shouldPerform(OptOptions options)
Redefine shouldPerform so that none of the subphases will occur unless we pass through this test.

Overrides:
shouldPerform in class OptimizationPlanCompositeElement
Parameters:
options - The Options object for the current compilation.
Returns:
true if the plan element should be performed.

tooBig

static boolean tooBig(IR ir)

usesOrDefsPhysicalRegisterOrAddressType

public static boolean usesOrDefsPhysicalRegisterOrAddressType(Instruction inst)