org.jikesrvm.compilers.opt.ssa
Class IndexPropagation

java.lang.Object
  extended by org.jikesrvm.compilers.opt.driver.CompilerPhase
      extended by org.jikesrvm.compilers.opt.ssa.IndexPropagation

public final class IndexPropagation
extends CompilerPhase

Perform index propagation (see Fink, Knobe && Sarkar, SAS 2000)

This analysis computes for each Array SSA variable A, the set of value numbers V(k) such that location A[k] is "available" at def A, and thus at all uses of A

We formulate this as a data flow problem as described in the paper.

This class relies on Array SSA form, global value numbering, and the dataflow equation solver framework.

TODO: This implementation is not terribly efficient. Speed it up.


Nested Class Summary
(package private) static class IndexPropagation.ArrayCell
          An ArrayCell is a lattice cell for the index propagation problem, used in redundant load elimination for one-dimensional arrays.
(package private) static class IndexPropagation.ObjectCell
          An ObjectCell is a lattice cell for the index propagation problem, used in redundant load elimination for fields.
 
Field Summary
private static Constructor<CompilerPhase> constructor
          Constructor for this compiler phase
private static boolean DEBUG
          Print verbose debugging messages?
 
Fields inherited from class org.jikesrvm.compilers.opt.driver.CompilerPhase
container
 
Constructor Summary
IndexPropagation()
           
 
Method Summary
 Constructor<CompilerPhase> getClassConstructor()
          Get a constructor object for this compiler phase
 String getName()
          Return the name of this compiler phase.
 void perform(IR ir)
          Perform the analysis.
 boolean shouldPerform(OptOptions options)
          This method determines if the phase should be run, based on the Options object it is passed.
 
Methods inherited from class org.jikesrvm.compilers.opt.driver.CompilerPhase
dumpIR, dumpIR, getCompilerPhaseConstructor, getCompilerPhaseConstructor, newExecution, performPhase, printingEnabled, reportAdditionalStats, setContainer, verify
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

constructor

private static final Constructor<CompilerPhase> constructor
Constructor for this compiler phase


DEBUG

private static final boolean DEBUG
Print verbose debugging messages?

See Also:
Constant Field Values
Constructor Detail

IndexPropagation

public IndexPropagation()
Method Detail

getClassConstructor

public Constructor<CompilerPhase> getClassConstructor()
Get a constructor object for this compiler phase

Overrides:
getClassConstructor in class CompilerPhase
Returns:
compiler phase constructor

shouldPerform

public boolean shouldPerform(OptOptions options)
Description copied from class: CompilerPhase
This method determines if the phase should be run, based on the Options object it is passed. By default, phases are always performed. Subclasses should override this method if they only want to be performed conditionally.

Overrides:
shouldPerform in class CompilerPhase
Parameters:
options - the compiler options for the compilation
Returns:
true iff SSA is constructed on the HIR

getName

public String getName()
Return the name of this compiler phase.

Specified by:
getName in class CompilerPhase
Returns:
"Index Propagation"

perform

public void perform(IR ir)
Perform the analysis.

Pre-condition: The IR is in Array SSA form and global value numbers have been computed.

Specified by:
perform in class CompilerPhase
Parameters:
ir - the IR to optimize