LiveRanges are represented as half-open ranges. Fix the findLiveInMBBs code
authorDan Gohman <gohman@apple.com>
Wed, 26 Nov 2008 05:50:31 +0000 (05:50 +0000)
committerDan Gohman <gohman@apple.com>
Wed, 26 Nov 2008 05:50:31 +0000 (05:50 +0000)
and the LiveInterval.h top-level comment and accordingly. This fixes blocks
having spurious live-in registers in boundary cases.

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

include/llvm/CodeGen/LiveInterval.h
lib/CodeGen/LiveIntervalAnalysis.cpp

index 024ca92af9f7ca30bd21da9ba72f49ab16d1f254..7ef24897d4be8c0c68c84388ca27c57b5f6317ed 100644 (file)
@@ -9,7 +9,7 @@
 //
 // This file implements the LiveRange and LiveInterval classes.  Given some
 // numbering of each the machine instructions an interval [i, j) is said to be a
-// live interval for register v if there is no instruction with number j' > j
+// live interval for register v if there is no instruction with number j' >= j
 // such that v is live at j' and there is no instruction with number i' < i such
 // that v is live at i'. In this implementation intervals can have holes,
 // i.e. an interval might look like [1,20), [50,65), [1000,1001).  Each
index 2a979e19eb560ec2d3be3b16aba3763f89d6c0d5..1de31b9da2cf1601b9b15a8f60551b6626c64859 100644 (file)
@@ -750,7 +750,7 @@ bool LiveIntervals::findLiveInMBBs(unsigned Start, unsigned End,
 
   bool ResVal = false;
   while (I != Idx2MBBMap.end()) {
-    if (I->first > End)
+    if (I->first >= End)
       break;
     MBBs.push_back(I->second);
     ResVal = true;