]> granicus.if.org Git - llvm/commitdiff
RA: Replace asserts related to empty live intervals
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Mon, 24 Jul 2017 18:07:55 +0000 (18:07 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Mon, 24 Jul 2017 18:07:55 +0000 (18:07 +0000)
These don't exactly assert the same thing anymore, and
allow empty live intervals with non-empty uses.

Removed in r308808 and r308813.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308906 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/InlineSpiller.cpp
lib/CodeGen/RegAllocBase.cpp

index 407fd2477a67d632649e4db2ed85d3c6ed91575e..eda4f74c78749345ac1011e86b6a9f3c127d6a4c 100644 (file)
@@ -644,7 +644,10 @@ void InlineSpiller::reMaterializeAll() {
       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.erase(RegsToSpill.begin() + ResultPos, RegsToSpill.end());
index 5a80bd95d6e4d56cca907aefd251559d5711ba3b..7b4fbace2c1c1afc8151209b5509b915b6f1c35a 100644 (file)
@@ -133,11 +133,13 @@ void RegAllocBase::allocatePhysRegs() {
     if (AvailablePhysReg)
       Matrix->assign(*VirtReg, AvailablePhysReg);
 
-    for (VirtRegVec::iterator I = SplitVRegs.begin(), E = SplitVRegs.end();
-         I != E; ++I) {
-      LiveInterval *SplitVirtReg = &LIS->getInterval(*I);
+    for (unsigned Reg : SplitVRegs) {
+      assert(LIS->hasInterval(Reg));
+
+      LiveInterval *SplitVirtReg = &LIS->getInterval(Reg);
       assert(!VRM->hasPhys(SplitVirtReg->reg) && "Register already assigned");
       if (MRI->reg_nodbg_empty(SplitVirtReg->reg)) {
+        assert(SplitVirtReg->empty() && "Non-empty but used interval");
         DEBUG(dbgs() << "not queueing unused  " << *SplitVirtReg << '\n');
         aboutToRemoveInterval(*SplitVirtReg);
         LIS->removeInterval(SplitVirtReg->reg);