|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jikesrvm.compilers.opt.DefUse
public final class DefUse
This class computes du-lists and associated information.
Note: DU operands are stored on the USE lists, but not the DEF lists.
Nested Class Summary | |
---|---|
private static class |
DefUse.RegOpListWalker
Utility class to encapsulate walking a use/def list. |
Field Summary | |
---|---|
(package private) static boolean |
DEBUG
|
(package private) static boolean |
SUPRESS_DU_FOR_PHYSICALS
|
(package private) static boolean |
TRACE_DU_ACTIONS
|
Constructor Summary | |
---|---|
DefUse()
|
Method Summary | |
---|---|
static void |
clearDU(IR ir)
Clear defList, useList for an IR. |
static void |
computeDU(IR ir)
Compute the register list and def-use lists for a method. |
static Enumeration<RegisterOperand> |
defs(Register reg)
Enumerate all operands that def a given register. |
(package private) static boolean |
exactlyOneUse(Register reg)
Does a given register have exactly one use? |
private static void |
logAppearance(Register reg,
int bbNum)
Mark that we have seen a register in a particular basic block, and whether we saw a use |
static void |
mergeRegisters(IR ir,
Register reg1,
Register reg2)
Merge register reg2 into register reg1. |
(package private) static void |
printDefs(Register reg)
Print all the instructions that def a register. |
(package private) static void |
printUses(Register reg)
Print all the instructions that usea register. |
static void |
recomputeSpansBasicBlock(IR ir)
Recompute spansBasicBlock flags for all registers. |
static void |
recomputeSSA(IR ir)
Recompute isSSA for all registers by traversing register
list. |
static void |
recordDef(RegisterOperand regOp)
Record a def of a register |
static void |
recordDefUse(RegisterOperand regOp)
Record a def/use of a register TODO: For now we just pretend this is a use!!!! |
static void |
recordUse(RegisterOperand regOp)
Record a use of a register |
static void |
removeDef(RegisterOperand regOp)
Record that a def of a register no longer applies |
static void |
removeInstructionAndUpdateDU(Instruction s)
Remove an instruction and update register lists. |
static void |
removeUse(RegisterOperand regOp)
Record that a use of a register no longer applies |
static void |
replaceInstructionAndUpdateDU(Instruction oldI,
Instruction newI)
Replace an instruction and update register lists. |
private static boolean |
seenInDifferentBlock(Register reg,
int bbNum)
Have we seen this register in a different basic block? |
static void |
transferUse(RegisterOperand origRegOp,
RegisterOperand newRegOp)
This code changes the use in origRegOp to use
the use in newRegOp . |
static void |
updateDUForNewInstruction(Instruction s)
Update register lists to account for the effect of a new instruction s |
static Enumeration<RegisterOperand> |
uses(Register reg)
Enumerate all operands that use a given register. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
static final boolean DEBUG
static final boolean TRACE_DU_ACTIONS
static final boolean SUPRESS_DU_FOR_PHYSICALS
Constructor Detail |
---|
public DefUse()
Method Detail |
---|
public static void clearDU(IR ir)
ir
- the IR in questionpublic static void computeDU(IR ir)
ir
- the IR in questionpublic static void recordUse(RegisterOperand regOp)
regOp
- the operand that uses the registerpublic static void recordDefUse(RegisterOperand regOp)
regOp
- the operand that uses the registerpublic static void recordDef(RegisterOperand regOp)
regOp
- the operand that uses the registerpublic static void removeUse(RegisterOperand regOp)
regOp
- the operand that uses the registerpublic static void removeDef(RegisterOperand regOp)
regOp
- the operand that uses the registerpublic static void transferUse(RegisterOperand origRegOp, RegisterOperand newRegOp)
origRegOp
to use
the use in newRegOp
.
If the type of origRegOp
is not a reference, but the
type of newRegOp
is a reference, we need to update
origRegOp
to be a reference.
Otherwise, the GC map code will be incorrect. -- Mike Hind
origRegOp
- the register operand to changenewRegOp
- the register operand to use for the changepublic static void removeInstructionAndUpdateDU(Instruction s)
public static void updateDUForNewInstruction(Instruction s)
public static void replaceInstructionAndUpdateDU(Instruction oldI, Instruction newI)
public static Enumeration<RegisterOperand> uses(Register reg)
public static Enumeration<RegisterOperand> defs(Register reg)
static boolean exactlyOneUse(Register reg)
static void printDefs(Register reg)
reg
- static void printUses(Register reg)
reg
- public static void recomputeSSA(IR ir)
isSSA
for all registers by traversing register
list.
NOTE: the DU MUST be computed BEFORE calling this function
ir
- the IR in questionpublic static void mergeRegisters(IR ir, Register reg1, Register reg2)
public static void recomputeSpansBasicBlock(IR ir)
ir
- the IR in questionprivate static void logAppearance(Register reg, int bbNum)
reg
- the registerbbNum
- the number of the basic blockprivate static boolean seenInDifferentBlock(Register reg, int bbNum)
reg
- the registerbbNum
- the number of the basic block
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |