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 | 76c97afbbc37a4f7dfbf3c884e767a1862dc430e (patch) | |
tree | a9503a58e21dd67b3b2200fbacdfa9e4c3bf8d35 /llvm/lib/CodeGen | |
parent | fd0d55ec69560679e73f4bef9b558b3a2e1c1626 (diff) | |
download | bcm5719-llvm-76c97afbbc37a4f7dfbf3c884e767a1862dc430e.tar.gz bcm5719-llvm-76c97afbbc37a4f7dfbf3c884e767a1862dc430e.zip |
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
llvm-svn: 23865
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/LiveInterval.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/LiveInterval.cpp b/llvm/lib/CodeGen/LiveInterval.cpp index a7f1eb357ee..b0f09297b3e 100644 --- a/llvm/lib/CodeGen/LiveInterval.cpp +++ b/llvm/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); } |