Take another .7 seconds off of linear scan time.
authorChris Lattner <sabre@nondot.org>
Thu, 18 Nov 2004 04:02:11 +0000 (04:02 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 18 Nov 2004 04:02:11 +0000 (04:02 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17936 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/LiveInterval.cpp

index 3c7e8dd763216f1eea5d20c2764330e54cc78c37..4a1720f7013b616434efdaa969c10dc9824a6428 100644 (file)
@@ -68,14 +68,16 @@ bool LiveInterval::overlapsFrom(const LiveInterval& other,
   const_iterator je = other.end();
 
   assert((StartPos->start <= i->start || StartPos == other.begin()) &&
-         "Bogus start position hint!");
+         StartPos != other.end() && "Bogus start position hint!");
 
   if (i->start < j->start) {
     i = std::upper_bound(i, ie, j->start);
     if (i != ranges.begin()) --i;
   } else if (j->start < i->start) {
-    j = std::upper_bound(j, je, i->start);
-    if (j != other.ranges.begin()) --j;
+    if ((++StartPos)->start <= i->start) {
+      j = std::upper_bound(j, je, i->start);
+      if (j != other.ranges.begin()) --j;
+    }
   } else {
     return true;
   }