summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlkis Evlogimenos <alkis@evlogimenos.com>2004-01-14 00:20:09 +0000
committerAlkis Evlogimenos <alkis@evlogimenos.com>2004-01-14 00:20:09 +0000
commit9739736b94b1116be2043e05567aa8899593ab29 (patch)
treeb2dcd124b91e2b9f37a4e03aa1791b53e2cc442b
parent5ab20273a4cc08f3d2451e97a74e6caad50a7efd (diff)
downloadllvm-9739736b94b1116be2043e05567aa8899593ab29.tar.gz
llvm-9739736b94b1116be2043e05567aa8899593ab29.tar.bz2
llvm-9739736b94b1116be2043e05567aa8899593ab29.tar.xz
Fix bug in LiveIntervals::Interval::overlaps and
LiveIntervals::Interval::liveAt. Both were considering the live ranges closed in the end, when they are actually open. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10835 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/LiveIntervalAnalysis.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/CodeGen/LiveIntervalAnalysis.cpp b/lib/CodeGen/LiveIntervalAnalysis.cpp
index acc32117c0..fb577228e8 100644
--- a/lib/CodeGen/LiveIntervalAnalysis.cpp
+++ b/lib/CodeGen/LiveIntervalAnalysis.cpp
@@ -366,7 +366,7 @@ void LiveIntervals::Interval::mergeRangesBackward(Ranges::iterator it)
bool LiveIntervals::Interval::liveAt(unsigned index) const
{
Ranges::const_iterator r = ranges.begin();
- while (r != ranges.end() && index < r->second) {
+ while (r != ranges.end() && index < (r->second - 1)) {
if (index >= r->first)
return true;
++r;
@@ -381,7 +381,7 @@ bool LiveIntervals::Interval::overlaps(const Interval& other) const
while (i != ranges.end() && j != other.ranges.end()) {
if (i->first < j->first) {
- if (i->second > j->first) {
+ if ((i->second - 1) > j->first) {
return true;
}
else {
@@ -389,7 +389,7 @@ bool LiveIntervals::Interval::overlaps(const Interval& other) const
}
}
else if (j->first < i->first) {
- if (j->second > i->first) {
+ if ((j->second - 1) > i->first) {
return true;
}
else {