summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/LiveInterval.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-07-23 18:13:24 +0000
committerChris Lattner <sabre@nondot.org>2004-07-23 18:13:24 +0000
commitc96d299569b6c5436de9a3975e213397e043f46f (patch)
treeb229b3c5c61cb0ded814bce3066cc81fb2e5a051 /llvm/lib/CodeGen/LiveInterval.cpp
parent856383326ad2da5e9bff007815318ff03ac06991 (diff)
downloadbcm5719-llvm-c96d299569b6c5436de9a3975e213397e043f46f.tar.gz
bcm5719-llvm-c96d299569b6c5436de9a3975e213397e043f46f.zip
Instead of searching for a live interval pair, search for a location. This gives
a very modest speedup of .3 seconds compiling 176.gcc (out of 20s). llvm-svn: 15136
Diffstat (limited to 'llvm/lib/CodeGen/LiveInterval.cpp')
-rw-r--r--llvm/lib/CodeGen/LiveInterval.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/LiveInterval.cpp b/llvm/lib/CodeGen/LiveInterval.cpp
index 5954b59f150..b0189daf83e 100644
--- a/llvm/lib/CodeGen/LiveInterval.cpp
+++ b/llvm/lib/CodeGen/LiveInterval.cpp
@@ -30,16 +30,14 @@ using namespace llvm;
// definition of the variable it represents. This is because slot 1 is
// used (def slot) and spans up to slot 3 (store slot).
//
-bool LiveInterval::liveAt(unsigned index) const {
- LiveRange dummy(index, index+1);
- Ranges::const_iterator r = std::upper_bound(ranges.begin(),
- ranges.end(),
- dummy);
+bool LiveInterval::liveAt(unsigned I) const {
+ Ranges::const_iterator r = std::upper_bound(ranges.begin(), ranges.end(), I);
+
if (r == ranges.begin())
return false;
--r;
- return index >= r->start && index < r->end;
+ return I >= r->start && I < r->end;
}
// An example for overlaps():
OpenPOWER on IntegriCloud