RA: Replace asserts related to empty live intervals

These don't exactly assert the same thing anymore, and
allow empty live intervals with non-empty uses.

Removed in r308808 and r308813.

llvm-svn: 308906
This commit is contained in:
Matt Arsenault 2017-07-24 18:07:55 +00:00
parent 8bbb130793
commit 5fbc87021e
2 changed files with 9 additions and 4 deletions

View File

@ -644,7 +644,10 @@ void InlineSpiller::reMaterializeAll() {
continue; continue;
} }
assert(LIS.hasInterval(Reg) && "Reg with no interval"); assert(LIS.hasInterval(Reg) &&
(!LIS.getInterval(Reg).empty() || !MRI.reg_nodbg_empty(Reg)) &&
"Empty and not used live-range?!");
RegsToSpill[ResultPos++] = Reg; RegsToSpill[ResultPos++] = Reg;
} }
RegsToSpill.erase(RegsToSpill.begin() + ResultPos, RegsToSpill.end()); RegsToSpill.erase(RegsToSpill.begin() + ResultPos, RegsToSpill.end());

View File

@ -133,11 +133,13 @@ void RegAllocBase::allocatePhysRegs() {
if (AvailablePhysReg) if (AvailablePhysReg)
Matrix->assign(*VirtReg, AvailablePhysReg); Matrix->assign(*VirtReg, AvailablePhysReg);
for (VirtRegVec::iterator I = SplitVRegs.begin(), E = SplitVRegs.end(); for (unsigned Reg : SplitVRegs) {
I != E; ++I) { assert(LIS->hasInterval(Reg));
LiveInterval *SplitVirtReg = &LIS->getInterval(*I);
LiveInterval *SplitVirtReg = &LIS->getInterval(Reg);
assert(!VRM->hasPhys(SplitVirtReg->reg) && "Register already assigned"); assert(!VRM->hasPhys(SplitVirtReg->reg) && "Register already assigned");
if (MRI->reg_nodbg_empty(SplitVirtReg->reg)) { if (MRI->reg_nodbg_empty(SplitVirtReg->reg)) {
assert(SplitVirtReg->empty() && "Non-empty but used interval");
DEBUG(dbgs() << "not queueing unused " << *SplitVirtReg << '\n'); DEBUG(dbgs() << "not queueing unused " << *SplitVirtReg << '\n');
aboutToRemoveInterval(*SplitVirtReg); aboutToRemoveInterval(*SplitVirtReg);
LIS->removeInterval(SplitVirtReg->reg); LIS->removeInterval(SplitVirtReg->reg);