diff options
author | Chris Lattner <sabre@nondot.org> | 2005-10-21 06:41:30 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-10-21 06:41:30 +0000 |
commit | 9e20d352c2fec5731857313014107a586387d242 (patch) | |
tree | 69dc1653d54d48bce2672dd813499e58fdee73de /lib | |
parent | ae1641c39fe9886e4b22a5d79b5a25b4041b62bd (diff) | |
download | external_llvm-9e20d352c2fec5731857313014107a586387d242.zip external_llvm-9e20d352c2fec5731857313014107a586387d242.tar.gz external_llvm-9e20d352c2fec5731857313014107a586387d242.tar.bz2 |
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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23865 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CodeGen/LiveInterval.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/CodeGen/LiveInterval.cpp b/lib/CodeGen/LiveInterval.cpp index a7f1eb3..b0f0929 100644 --- a/lib/CodeGen/LiveInterval.cpp +++ b/lib/CodeGen/LiveInterval.cpp @@ -164,8 +164,8 @@ bool LiveInterval::joinable(const LiveInterval &other, unsigned CopyIdx) const { 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 @@ void LiveInterval::extendIntervalEndTo(Ranges::iterator I, unsigned NewEnd) { // 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); } |