summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/LiveIntervals.cpp
diff options
context:
space:
mode:
authorAlkis Evlogimenos <alkis@evlogimenos.com>2004-02-05 20:45:40 +0000
committerAlkis Evlogimenos <alkis@evlogimenos.com>2004-02-05 20:45:40 +0000
commit1165c1081e0e5fe6f55142c69c2e778f308c0d86 (patch)
treed1054f524d4c68c1716214a7f098a83e31a73787 /llvm/lib/CodeGen/LiveIntervals.cpp
parent66c16d144e9eab0a2e885051b987f1dd3ad026af (diff)
downloadbcm5719-llvm-1165c1081e0e5fe6f55142c69c2e778f308c0d86.tar.gz
bcm5719-llvm-1165c1081e0e5fe6f55142c69c2e778f308c0d86.zip
We don't need to scan the blocks that we are live-in on every
access. Rather we only have to do it on the creation of the interval. llvm-svn: 11135
Diffstat (limited to 'llvm/lib/CodeGen/LiveIntervals.cpp')
-rw-r--r--llvm/lib/CodeGen/LiveIntervals.cpp25
1 files changed, 13 insertions, 12 deletions
diff --git a/llvm/lib/CodeGen/LiveIntervals.cpp b/llvm/lib/CodeGen/LiveIntervals.cpp
index bef7653c05d..f1bb4993370 100644
--- a/llvm/lib/CodeGen/LiveIntervals.cpp
+++ b/llvm/lib/CodeGen/LiveIntervals.cpp
@@ -162,22 +162,23 @@ void LiveIntervals::handleVirtualRegisterDef(MachineBasicBlock* mbb,
// update interval index for this register
r2iMap_.insert(r2iit, std::make_pair(reg, --intervals_.end()));
interval = &intervals_.back();
- }
- else {
- interval = &*r2iit->second;
- }
- // iterate over all of the blocks that the variable is completely
- // live in, adding them to the live interval
- for (unsigned i = 0, e = vi.AliveBlocks.size(); i != e; ++i) {
- if (vi.AliveBlocks[i]) {
- MachineBasicBlock* mbb = lv_->getIndexMachineBasicBlock(i);
- if (!mbb->empty()) {
- interval->addRange(getInstructionIndex(mbb->front()),
- getInstructionIndex(mbb->back()) + 1);
+ // iterate over all of the blocks that the variable is
+ // completely live in, adding them to the live
+ // interval. obviously we only need to do this once.
+ for (unsigned i = 0, e = vi.AliveBlocks.size(); i != e; ++i) {
+ if (vi.AliveBlocks[i]) {
+ MachineBasicBlock* mbb = lv_->getIndexMachineBasicBlock(i);
+ if (!mbb->empty()) {
+ interval->addRange(getInstructionIndex(mbb->front()),
+ getInstructionIndex(mbb->back()) + 1);
+ }
}
}
}
+ else {
+ interval = &*r2iit->second;
+ }
bool killedInDefiningBasicBlock = false;
for (int i = 0, e = vi.Kills.size(); i != e; ++i) {
OpenPOWER on IntegriCloud