[llvm-commits] [llvm] r121319 - in /llvm/trunk/lib/CodeGen: LiveIntervalUnion.cpp RegAllocGreedy.cpp

Jakob Stoklund Olesen stoklund at 2pi.dk
Wed Dec 8 15:51:35 PST 2010


Author: stoklund
Date: Wed Dec  8 17:51:35 2010
New Revision: 121319

URL: http://llvm.org/viewvc/llvm-project?rev=121319&view=rev
Log:
Properly deal with empty intervals when checking for interference.

Modified:
    llvm/trunk/lib/CodeGen/LiveIntervalUnion.cpp
    llvm/trunk/lib/CodeGen/RegAllocGreedy.cpp

Modified: llvm/trunk/lib/CodeGen/LiveIntervalUnion.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveIntervalUnion.cpp?rev=121319&r1=121318&r2=121319&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/LiveIntervalUnion.cpp (original)
+++ llvm/trunk/lib/CodeGen/LiveIntervalUnion.cpp Wed Dec  8 17:51:35 2010
@@ -111,9 +111,10 @@
 // Assumes that segments are sorted by start position in both
 // LiveInterval and LiveSegments.
 void LiveIntervalUnion::Query::findIntersection(InterferenceResult &IR) const {
-
   // Search until reaching the end of the LiveUnion segments.
   LiveInterval::iterator VirtRegEnd = VirtReg->end();
+  if (IR.VirtRegI == VirtRegEnd)
+    return;
   while (IR.LiveUnionI.valid()) {
     // Slowly advance the live virtual reg iterator until we surpass the next
     // segment in LiveUnion.

Modified: llvm/trunk/lib/CodeGen/RegAllocGreedy.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocGreedy.cpp?rev=121319&r1=121318&r2=121319&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/RegAllocGreedy.cpp (original)
+++ llvm/trunk/lib/CodeGen/RegAllocGreedy.cpp Wed Dec  8 17:51:35 2010
@@ -173,6 +173,7 @@
       // Found an available register.
       return PhysReg;
     }
+    assert(!VirtReg.empty() && "Empty VirtReg has interference");
     LiveInterval *interferingVirtReg =
       Queries[interfReg].firstInterference().liveUnionPos().value();
 





More information about the llvm-commits mailing list