summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/RegAllocLinearScan.cpp
diff options
context:
space:
mode:
authorAlkis Evlogimenos <alkis@evlogimenos.com>2004-01-16 20:17:05 +0000
committerAlkis Evlogimenos <alkis@evlogimenos.com>2004-01-16 20:17:05 +0000
commitd86933d21df4af1daa02f66c4ba877683318d95d (patch)
treea2f66238ebd57a7a694abaa5b0e0029389ba11ff /llvm/lib/CodeGen/RegAllocLinearScan.cpp
parente9c6ba891e0eb4b1df866a2d0014a12af8b58cf7 (diff)
downloadbcm5719-llvm-d86933d21df4af1daa02f66c4ba877683318d95d.tar.gz
bcm5719-llvm-d86933d21df4af1daa02f66c4ba877683318d95d.zip
Fold open interval ends handling into
LiveIntervals::Interval::expiredAt() and simplify regalloc code. llvm-svn: 10894
Diffstat (limited to 'llvm/lib/CodeGen/RegAllocLinearScan.cpp')
-rw-r--r--llvm/lib/CodeGen/RegAllocLinearScan.cpp14
1 files changed, 4 insertions, 10 deletions
diff --git a/llvm/lib/CodeGen/RegAllocLinearScan.cpp b/llvm/lib/CodeGen/RegAllocLinearScan.cpp
index a88c55dd527..abd13900931 100644
--- a/llvm/lib/CodeGen/RegAllocLinearScan.cpp
+++ b/llvm/lib/CodeGen/RegAllocLinearScan.cpp
@@ -428,11 +428,8 @@ void RA::processActiveIntervals(IntervalPtrs::value_type cur)
DEBUG(std::cerr << "\tprocessing active intervals:\n");
for (IntervalPtrs::iterator i = active_.begin(); i != active_.end();) {
unsigned reg = (*i)->reg;
- // remove expired intervals. we expire earlier because this if
- // an interval expires this is going to be the last use. in
- // this case we can reuse the register for a def in the same
- // instruction
- if ((*i)->expiredAt(cur->start() + 1)) {
+ // remove expired intervals
+ if ((*i)->expiredAt(cur->start())) {
DEBUG(std::cerr << "\t\tinterval " << **i << " expired\n");
if (reg >= MRegisterInfo::FirstVirtualRegister) {
reg = v2pMap_[reg];
@@ -465,11 +462,8 @@ void RA::processInactiveIntervals(IntervalPtrs::value_type cur)
for (IntervalPtrs::iterator i = inactive_.begin(); i != inactive_.end();) {
unsigned reg = (*i)->reg;
- // remove expired intervals. we expire earlier because this if
- // an interval expires this is going to be the last use. in
- // this case we can reuse the register for a def in the same
- // instruction
- if ((*i)->expiredAt(cur->start() + 1)) {
+ // remove expired intervals
+ if ((*i)->expiredAt(cur->start())) {
DEBUG(std::cerr << "\t\t\tinterval " << **i << " expired\n");
// remove from inactive
i = inactive_.erase(i);
OpenPOWER on IntegriCloud