Allow for live in registers for eh landing pads.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34475 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jim Laskey 2007-02-21 22:41:17 +00:00
parent 30b8e51add
commit 9b25b8ca24
2 changed files with 9 additions and 6 deletions

View File

@ -240,7 +240,9 @@ namespace llvm {
unsigned SrcReg); unsigned SrcReg);
/// handleLiveInRegister - Create interval for a livein register. /// handleLiveInRegister - Create interval for a livein register.
void handleLiveInRegister(MachineBasicBlock* mbb, LiveInterval &interval); void handleLiveInRegister(MachineBasicBlock* mbb,
unsigned MIIdx,
LiveInterval &interval);
/// Return true if the two specified registers belong to different /// Return true if the two specified registers belong to different
/// register classes. The registers may be either phys or virt regs. /// register classes. The registers may be either phys or virt regs.

View File

@ -658,14 +658,15 @@ void LiveIntervals::handleRegisterDef(MachineBasicBlock *MBB,
} }
void LiveIntervals::handleLiveInRegister(MachineBasicBlock *MBB, void LiveIntervals::handleLiveInRegister(MachineBasicBlock *MBB,
unsigned MIIdx,
LiveInterval &interval) { LiveInterval &interval) {
DOUT << "\t\tlivein register: "; DEBUG(printRegName(interval.reg)); DOUT << "\t\tlivein register: "; DEBUG(printRegName(interval.reg));
// Look for kills, if it reaches a def before it's killed, then it shouldn't // Look for kills, if it reaches a def before it's killed, then it shouldn't
// be considered a livein. // be considered a livein.
MachineBasicBlock::iterator mi = MBB->begin(); MachineBasicBlock::iterator mi = MBB->begin();
unsigned baseIndex = 0; unsigned baseIndex = MIIdx;
unsigned start = 0; unsigned start = baseIndex;
unsigned end = start; unsigned end = start;
while (mi != MBB->end()) { while (mi != MBB->end()) {
if (lv_->KillsRegister(mi, interval.reg)) { if (lv_->KillsRegister(mi, interval.reg)) {
@ -690,8 +691,8 @@ exit:
assert(start < end && "did not find end of interval?"); assert(start < end && "did not find end of interval?");
LiveRange LR(start, end, interval.getNextValue(~0U, 0)); LiveRange LR(start, end, interval.getNextValue(~0U, 0));
interval.addRange(LR);
DOUT << " +" << LR << '\n'; DOUT << " +" << LR << '\n';
interval.addRange(LR);
} }
/// computeIntervals - computes the live intervals for virtual /// computeIntervals - computes the live intervals for virtual
@ -715,9 +716,9 @@ void LiveIntervals::computeIntervals() {
// Create intervals for live-ins to this BB first. // Create intervals for live-ins to this BB first.
for (MachineBasicBlock::const_livein_iterator LI = MBB->livein_begin(), for (MachineBasicBlock::const_livein_iterator LI = MBB->livein_begin(),
LE = MBB->livein_end(); LI != LE; ++LI) { LE = MBB->livein_end(); LI != LE; ++LI) {
handleLiveInRegister(MBB, getOrCreateInterval(*LI)); handleLiveInRegister(MBB, MIIndex, getOrCreateInterval(*LI));
for (const unsigned* AS = mri_->getAliasSet(*LI); *AS; ++AS) for (const unsigned* AS = mri_->getAliasSet(*LI); *AS; ++AS)
handleLiveInRegister(MBB, getOrCreateInterval(*AS)); handleLiveInRegister(MBB, MIIndex, getOrCreateInterval(*AS));
} }
} }