Skip to content

Commit 5fbc870

Browse files
committed
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
1 parent 8bbb130 commit 5fbc870

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

llvm/lib/CodeGen/InlineSpiller.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,10 @@ void InlineSpiller::reMaterializeAll() {
644644
continue;
645645
}
646646

647-
assert(LIS.hasInterval(Reg) && "Reg with no interval");
647+
assert(LIS.hasInterval(Reg) &&
648+
(!LIS.getInterval(Reg).empty() || !MRI.reg_nodbg_empty(Reg)) &&
649+
"Empty and not used live-range?!");
650+
648651
RegsToSpill[ResultPos++] = Reg;
649652
}
650653
RegsToSpill.erase(RegsToSpill.begin() + ResultPos, RegsToSpill.end());

llvm/lib/CodeGen/RegAllocBase.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,13 @@ void RegAllocBase::allocatePhysRegs() {
133133
if (AvailablePhysReg)
134134
Matrix->assign(*VirtReg, AvailablePhysReg);
135135

136-
for (VirtRegVec::iterator I = SplitVRegs.begin(), E = SplitVRegs.end();
137-
I != E; ++I) {
138-
LiveInterval *SplitVirtReg = &LIS->getInterval(*I);
136+
for (unsigned Reg : SplitVRegs) {
137+
assert(LIS->hasInterval(Reg));
138+
139+
LiveInterval *SplitVirtReg = &LIS->getInterval(Reg);
139140
assert(!VRM->hasPhys(SplitVirtReg->reg) && "Register already assigned");
140141
if (MRI->reg_nodbg_empty(SplitVirtReg->reg)) {
142+
assert(SplitVirtReg->empty() && "Non-empty but used interval");
141143
DEBUG(dbgs() << "not queueing unused " << *SplitVirtReg << '\n');
142144
aboutToRemoveInterval(*SplitVirtReg);
143145
LIS->removeInterval(SplitVirtReg->reg);

0 commit comments

Comments
 (0)