[llvm-commits] CVS: llvm/lib/CodeGen/LiveInterval.cpp

Chris Lattner lattner at cs.uiuc.edu
Thu Oct 20 23:41:41 PDT 2005



Changes in directory llvm/lib/CodeGen:

LiveInterval.cpp updated: 1.26 -> 1.27
---
Log message:

Fix LiveInterval::getOverlapingRanges to take things in the right order
(an unused method).

Fix the merger so that it can merge ranges like this  [10:12)[16:40) with
[12:38) into [10:40) instead of bogus ranges.  This sort of input will be
possible for the merger coming shortly


---
Diffs of the changes:  (+3 -3)

 LiveInterval.cpp |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)


Index: llvm/lib/CodeGen/LiveInterval.cpp
diff -u llvm/lib/CodeGen/LiveInterval.cpp:1.26 llvm/lib/CodeGen/LiveInterval.cpp:1.27
--- llvm/lib/CodeGen/LiveInterval.cpp:1.26	Thu Oct 20 17:50:10 2005
+++ llvm/lib/CodeGen/LiveInterval.cpp	Fri Oct 21 01:41:30 2005
@@ -164,8 +164,8 @@
 void LiveInterval::getOverlapingRanges(const LiveInterval &other, 
                                        unsigned CopyIdx,
                                        std::vector<LiveRange*> &Ranges) {
-  const LiveRange *SourceLR = other.getLiveRangeContaining(CopyIdx-1);
-  const LiveRange *DestLR = getLiveRangeContaining(CopyIdx);
+  const LiveRange *SourceLR = getLiveRangeContaining(CopyIdx-1);
+  const LiveRange *DestLR = other.getLiveRangeContaining(CopyIdx);
   assert(SourceLR && DestLR && "Not joining due to a copy?");
   unsigned OtherValIdx = SourceLR->ValId;
   unsigned ThisValIdx = DestLR->ValId;
@@ -219,7 +219,7 @@
   // If the newly formed range now touches the range after it and if they have
   // the same value number, merge the two ranges into one range.
   Ranges::iterator Next = next(I);
-  if (Next != ranges.end() && Next->start == I->end && Next->ValId == ValId) {
+  if (Next != ranges.end() && Next->start <= I->end && Next->ValId == ValId) {
     I->end = Next->end;
     ranges.erase(Next);
   }






More information about the llvm-commits mailing list