public final class IndexPropagation extends CompilerPhase
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.
Modifier and Type | Class and Description |
---|---|
(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.
|
Modifier and Type | Field and Description |
---|---|
private static Constructor<CompilerPhase> |
constructor
Constructor for this compiler phase
|
private static boolean |
DEBUG
Print verbose debugging messages?
|
container
Constructor and Description |
---|
IndexPropagation() |
Modifier and Type | Method and Description |
---|---|
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.
|
dumpIR, dumpIR, getCompilerPhaseConstructor, getCompilerPhaseConstructor, newExecution, performPhase, printingEnabled, reportAdditionalStats, setContainer, verify
private static final Constructor<CompilerPhase> constructor
private static final boolean DEBUG
public IndexPropagation()
public Constructor<CompilerPhase> getClassConstructor()
getClassConstructor
in class CompilerPhase
public boolean shouldPerform(OptOptions options)
CompilerPhase
shouldPerform
in class CompilerPhase
options
- the compiler options for the compilationtrue
iff SSA is constructed on the HIRpublic String getName()
getName
in class CompilerPhase
public void perform(IR ir)
Pre-condition: The IR is in Array SSA form and global value numbers have been computed.
perform
in class CompilerPhase
ir
- the IR to optimize