aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/LiveInterval.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen/LiveInterval.cpp')
-rw-r--r--lib/CodeGen/LiveInterval.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/CodeGen/LiveInterval.cpp b/lib/CodeGen/LiveInterval.cpp
index a7f1eb357e..b0f09297b3 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);
}