aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/LiveInterval.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2008-02-15 18:24:29 +0000
committerEvan Cheng <evan.cheng@apple.com>2008-02-15 18:24:29 +0000
commitc8d044e4f779fdcfc5e7d592927740fd8f672a70 (patch)
tree101c003537c8d19f3d9ef2cd7a22a51d0c01dc32 /lib/CodeGen/LiveInterval.cpp
parentf20db159541bf27f5d2fdf8d4ba1c8b270b936df (diff)
downloadexternal_llvm-c8d044e4f779fdcfc5e7d592927740fd8f672a70.zip
external_llvm-c8d044e4f779fdcfc5e7d592927740fd8f672a70.tar.gz
external_llvm-c8d044e4f779fdcfc5e7d592927740fd8f672a70.tar.bz2
- Removing the infamous r2rMap_ and rep() method. Now the coalescer will update
register defs and uses after each successful coalescing. - Also removed a number of hacks and fixed some subtle kill information bugs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47167 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/LiveInterval.cpp')
-rw-r--r--lib/CodeGen/LiveInterval.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/CodeGen/LiveInterval.cpp b/lib/CodeGen/LiveInterval.cpp
index b09ffd4..741c35c 100644
--- a/lib/CodeGen/LiveInterval.cpp
+++ b/lib/CodeGen/LiveInterval.cpp
@@ -44,6 +44,27 @@ bool LiveInterval::liveAt(unsigned I) const {
return r->contains(I);
}
+// liveBeforeAndAt - Check if the interval is live at the index and the index
+// just before it. If index is liveAt, check if it starts a new live range.
+// If it does, then check if the previous live range ends at index-1.
+bool LiveInterval::liveBeforeAndAt(unsigned I) const {
+ Ranges::const_iterator r = std::upper_bound(ranges.begin(), ranges.end(), I);
+
+ if (r == ranges.begin())
+ return false;
+
+ --r;
+ if (!r->contains(I))
+ return false;
+ if (I != r->start)
+ return true;
+ // I is the start of a live range. Check if the previous live range ends
+ // at I-1.
+ if (r == ranges.begin())
+ return false;
+ return r->end == I;
+}
+
// overlaps - Return true if the intersection of the two live intervals is
// not empty.
//