diff options
author | Alkis Evlogimenos <alkis@evlogimenos.com> | 2004-01-31 23:48:47 +0000 |
---|---|---|
committer | Alkis Evlogimenos <alkis@evlogimenos.com> | 2004-01-31 23:48:47 +0000 |
commit | 52220f61bba91ab787d4cc0aee47df4e2ca55c04 (patch) | |
tree | e67aa97f440ca9a573445d52ace6b994bda5b106 /lib | |
parent | 02ba13c9897ae2b19f9201e57460d7ee2b753a0b (diff) | |
download | external_llvm-52220f61bba91ab787d4cc0aee47df4e2ca55c04.zip external_llvm-52220f61bba91ab787d4cc0aee47df4e2ca55c04.tar.gz external_llvm-52220f61bba91ab787d4cc0aee47df4e2ca55c04.tar.bz2 |
Apply final part of Chris' patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11040 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CodeGen/LiveIntervalAnalysis.cpp | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/lib/CodeGen/LiveIntervalAnalysis.cpp b/lib/CodeGen/LiveIntervalAnalysis.cpp index a762ede..2eb9626 100644 --- a/lib/CodeGen/LiveIntervalAnalysis.cpp +++ b/lib/CodeGen/LiveIntervalAnalysis.cpp @@ -168,17 +168,15 @@ void LiveIntervals::handleVirtualRegisterDef(MachineBasicBlock* mbb, interval = &*r2iit->second; } - for (MbbIndex2MbbMap::iterator - it = mbbi2mbbMap_.begin(), itEnd = mbbi2mbbMap_.end(); - it != itEnd; ++it) { - unsigned liveBlockIndex = it->first; - MachineBasicBlock* liveBlock = it->second; - if (liveBlockIndex < vi.AliveBlocks.size() && - vi.AliveBlocks[liveBlockIndex] && - !liveBlock->empty()) { - unsigned start = getInstructionIndex(liveBlock->front()); - unsigned end = getInstructionIndex(liveBlock->back()) + 1; - interval->addRange(start, end); + // 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); + } } } |