[llvm-commits] [llvm] r156685 - /llvm/trunk/lib/CodeGen/RegAllocBase.cpp

Jakob Stoklund Olesen stoklund at 2pi.dk
Fri May 11 17:33:28 PDT 2012


Author: stoklund
Date: Fri May 11 19:33:28 2012
New Revision: 156685

URL: http://llvm.org/viewvc/llvm-project?rev=156685&view=rev
Log:
Don't look for empty live ranges in the unions.

Empty live ranges represent undef and still get allocated, but they
won't appear in LiveIntervalUnions.

Patch by Patrik Hägglund!

Modified:
    llvm/trunk/lib/CodeGen/RegAllocBase.cpp

Modified: llvm/trunk/lib/CodeGen/RegAllocBase.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocBase.cpp?rev=156685&r1=156684&r2=156685&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/RegAllocBase.cpp (original)
+++ llvm/trunk/lib/CodeGen/RegAllocBase.cpp Fri May 11 19:33:28 2012
@@ -69,11 +69,14 @@
   for (LiveIntervals::iterator liItr = LIS->begin(), liEnd = LIS->end();
        liItr != liEnd; ++liItr) {
     unsigned reg = liItr->first;
+    LiveInterval* li = liItr->second;
     if (TargetRegisterInfo::isPhysicalRegister(reg)) continue;
     if (!VRM->hasPhys(reg)) continue; // spilled?
+    if (li->empty()) continue; // unionVRegs will only be filled if li is
+                               // non-empty
     unsigned PhysReg = VRM->getPhys(reg);
     if (!unionVRegs[PhysReg].test(reg)) {
-      dbgs() << "LiveVirtReg " << reg << " not in union " <<
+      dbgs() << "LiveVirtReg " << PrintReg(reg, TRI) << " not in union " <<
         TRI->getName(PhysReg) << "\n";
       llvm_unreachable("unallocated live vreg");
     }





More information about the llvm-commits mailing list