From 52220f61bba91ab787d4cc0aee47df4e2ca55c04 Mon Sep 17 00:00:00 2001 From: Alkis Evlogimenos Date: Sat, 31 Jan 2004 23:48:47 +0000 Subject: [PATCH] Apply final part of Chris' patch. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11040 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/LiveIntervalAnalysis.cpp | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/lib/CodeGen/LiveIntervalAnalysis.cpp b/lib/CodeGen/LiveIntervalAnalysis.cpp index a762ede860c..2eb9626abed 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); + } } } -- 2.34.1