public final class LiveInterval extends Object
Modifier and Type | Field and Description |
---|---|
private static boolean |
DEBUG |
private HashMap<BasicBlock,LiveIntervalElement> |
liveIntervals |
Constructor and Description |
---|
LiveInterval() |
Modifier and Type | Method and Description |
---|---|
private boolean |
containsUnresolvedElement(BasicBlock block,
Register reg)
Check to see if an unresolved LiveIntervalElement node for the register
passed exists for the basic block passed.
|
void |
createEndLiveRange(LiveSet set,
BasicBlock block,
Instruction inst)
This method iterates over each element in the the passed live set.
|
void |
createEndLiveRange(Register reg,
BasicBlock block,
Instruction inst)
This method checks if an existing unresolved live interval node, i.e.,
one that has an end instruction, but no beginning instruction, is present
for the register and basic block passed.
|
LiveIntervalEnumeration |
enumerateLiveIntervals(BasicBlock bb) |
LiveIntervalElement |
getFirstLiveIntervalElement(BasicBlock bb) |
void |
moveUpwardExposedRegsToFront(BasicBlock block)
This method finds any LiveInterval node that does not have a start
instruction (it is null) and moves this node to the front of the list.
|
private void |
prependLiveIntervalElement(BasicBlock block,
LiveIntervalElement elem) |
void |
printLiveIntervalList(BasicBlock block)
Print the live intervals for a block.
|
void |
setStartLiveRange(Register reg,
Instruction inst,
BasicBlock block)
This method finds the LiveInterval node for the register and basic block
passed.
|
private static final boolean DEBUG
private final HashMap<BasicBlock,LiveIntervalElement> liveIntervals
public LiveInterval()
public void createEndLiveRange(LiveSet set, BasicBlock block, Instruction inst)
set
- the set of registers, encoded as a LiveSet objectblock
- the basic blockinst
- the instruction where the register's live range ends,
null represents the end of the basic blockpublic void createEndLiveRange(Register reg, BasicBlock block, Instruction inst)
inst
. If one
already exists no action is taken.reg
- The registerblock
- The basic blockinst
- The end instruction to use, if we have to create a neode.private void prependLiveIntervalElement(BasicBlock block, LiveIntervalElement elem)
public void setStartLiveRange(Register reg, Instruction inst, BasicBlock block)
reg
- the register of interestinst
- the "begin" instructionblock
- the basic block of interestpublic void moveUpwardExposedRegsToFront(BasicBlock block)
block
- the basic block of interestprivate boolean containsUnresolvedElement(BasicBlock block, Register reg)
block
- the blockreg
- the register of interesttrue
if it does or false
if it does notpublic LiveIntervalElement getFirstLiveIntervalElement(BasicBlock bb)
public LiveIntervalEnumeration enumerateLiveIntervals(BasicBlock bb)
public void printLiveIntervalList(BasicBlock block)
block
- the block