class IndexPropagationSystem extends DF_System
Modifier and Type | Class and Description |
---|---|
(package private) static class |
IndexPropagationSystem.MeetOperator
Represents a MEET function (intersection) over Cells.
|
(package private) class |
IndexPropagationSystem.UpdateDefArrayOperator
Represents an UPDATE_DEF function over two ArrayCells.
|
(package private) class |
IndexPropagationSystem.UpdateDefObjectOperator
Represents an UPDATE_DEF function over two ObjectCells.
|
(package private) static class |
IndexPropagationSystem.UpdateUseArrayOperator
Represents an UPDATE_USE function over two ArrayCells.
|
(package private) static class |
IndexPropagationSystem.UpdateUseObjectOperator
Represents an UPDATE_USE function over two ObjectCells.
|
Modifier and Type | Field and Description |
---|---|
private IR |
ir
The governing IR.
|
private static IndexPropagationSystem.MeetOperator |
MEET
object representing the MEET operator
|
private SSADictionary |
ssa
Heap Array SSA lookaside information for the IR.
|
private GlobalValueNumberState |
valueNumbers
Results of global value numbering
|
Constructor and Description |
---|
IndexPropagationSystem(IR _ir)
Set up the system of dataflow equations.
|
Modifier and Type | Method and Description |
---|---|
(package private) void |
addUpdateArrayDefEquation(HeapVariable<?> A1,
HeapVariable<?> A2,
Object array,
Object index)
Add an equation to the system of the form
L(A1) = updateDef(L(A2), <VALNUM(array),VALNUM(index)>)
|
(package private) void |
addUpdateArrayUseEquation(HeapVariable<?> A1,
HeapVariable<?> A2,
Object array,
Object index)
Add an equation to the system of the form
L(A1) = updateUse(L(A2), <VALNUM(array),VALNUM(index)>)
|
(package private) void |
addUpdateObjectDefEquation(HeapVariable<?> A1,
HeapVariable<?> A2,
int valueNumber)
Add an equation to the system of the form
L(A1) = updateDef(L(A2), VALNUM(address))
|
(package private) void |
addUpdateObjectUseEquation(HeapVariable<?> A1,
HeapVariable<?> A2,
int valueNumber)
Add an equation to the system of the form
L(A1) = updateUse(L(A2), VALNUM(address))
|
protected void |
initializeLatticeCells()
Initialize the lattice variables.
|
protected void |
initializeWorkList()
Initialize the work list for the dataflow equation system.
|
protected DF_LatticeCell |
makeCell(Object o)
Create an DF_LatticeCell corresponding to an HeapVariable
|
(package private) void |
processALoad(Instruction s)
Update the set of dataflow equations to account for the actions
of ALoad instruction s
The load is of the form x = A[k].
|
(package private) void |
processAStore(Instruction s)
Update the set of dataflow equations to account for the actions
of AStore instruction s
The store is of the form A[k] = val.
|
(package private) void |
processCall(Instruction s)
Update the set of dataflow equations to account for the actions
of CALL instruction.
|
(package private) void |
processLoad(Instruction s)
Update the set of dataflow equations to account for the actions
of a Load instruction
The load is of the form x = A[k].
|
(package private) void |
processNew(Instruction s)
Update the set of dataflow equations to account for the actions
of allocation instruction s
|
(package private) void |
processPhi(Instruction s)
Update the set of dataflow equations to account for the actions
of Phi instruction.
|
(package private) void |
processStore(Instruction s)
Update the set of dataflow equations to account for the actions
of a Store instruction.
|
(package private) void |
setupEquations()
Walk through the IR and add dataflow equations for each instruction
that affects the values of Array SSA variables.
|
addAllEquationsToWorkList, addCellAppearancesToWorkList, addNewEquationsToWorkList, addToWorkList, changedCell, findOrCreateCell, getCell, getEquations, getNumberOfEquations, getSolution, newEquation, newEquation, solve, toString, updateWorkList
private final SSADictionary ssa
private final GlobalValueNumberState valueNumbers
private static final IndexPropagationSystem.MeetOperator MEET
IndexPropagationSystem(IR _ir)
_ir
- the IRprotected DF_LatticeCell makeCell(Object o)
protected void initializeLatticeCells()
initializeLatticeCells
in class DF_System
protected void initializeWorkList()
initializeWorkList
in class DF_System
void setupEquations()
void processLoad(Instruction s)
The load is of the form x = A[k]. let A_1 be the array SSA variable before the load, and A_2 the array SSA variable after the store. Then we add the dataflow equation L(A_2) = updateUse(L(A_1), VALNUM(k))
Intuitively, this equation represents the fact that A[k] is available after the store
s
- the Load instructionvoid processStore(Instruction s)
The store is of the form A[k] = val. let A_1 be the array SSA variable before the store, and A_2 the array SSA variable after the store. Then we add the dataflow equation L(A_2) = updateDef(L(A_1), VALNUM(k))
Intuitively, this equation represents the fact that A[k] is available after the store
s
- the Store instructionvoid processALoad(Instruction s)
The load is of the form x = A[k]. let A_1 be the array SSA variable before the load, and A_2 the array SSA variable after the load. Then we add the dataflow equation L(A_2) = updateUse(L(A_1), VALNUM(k))
Intuitively, this equation represents the fact that A[k] is available after the store
s
- the Aload instructionvoid processAStore(Instruction s)
The store is of the form A[k] = val. let A_1 be the array SSA variable before the store, and A_2 the array SSA variable after the store. Then we add the dataflow equation L(A_2) = update(L(A_1), VALNUM(k))
Intuitively, this equation represents the fact that A[k] is available after the store
s
- the Astore instructionvoid processNew(Instruction s)
s
- the New instructionvoid processCall(Instruction s)
s
- the Call instructionvoid processPhi(Instruction s)
The instruction has the form A1 = PHI (A2, A3, A4); We add the dataflow equation L(A1) = MEET(L(A2), L(A3), L(A4))
s
- the Phi instructionvoid addUpdateObjectDefEquation(HeapVariable<?> A1, HeapVariable<?> A2, int valueNumber)
A1
- variable in the equationA2
- variable in the equationvalueNumber
- value number of the addressvoid addUpdateObjectUseEquation(HeapVariable<?> A1, HeapVariable<?> A2, int valueNumber)
L(A1) = updateUse(L(A2), VALNUM(address))
A1
- variable in the equationA2
- variable in the equationvalueNumber
- value number of addressvoid addUpdateArrayDefEquation(HeapVariable<?> A1, HeapVariable<?> A2, Object array, Object index)
L(A1) = updateDef(L(A2), <VALNUM(array),VALNUM(index)>)
A1
- variable in the equationA2
- variable in the equationarray
- variable in the equationindex
- variable in the equationvoid addUpdateArrayUseEquation(HeapVariable<?> A1, HeapVariable<?> A2, Object array, Object index)
L(A1) = updateUse(L(A2), <VALNUM(array),VALNUM(index)>)
A1
- variable in the equationA2
- variable in the equationarray
- variable in the equationindex
- variable in the equation