From b606eaca1b149ef74c578a6a11d65339c125edab Mon Sep 17 00:00:00 2001 From: Alkis Evlogimenos Date: Mon, 2 Feb 2004 20:29:57 +0000 Subject: [PATCH] Should be more careful. The previously applied change made all counts outside of loops = 0. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11085 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/LiveIntervalAnalysis.cpp | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/lib/CodeGen/LiveIntervalAnalysis.cpp b/lib/CodeGen/LiveIntervalAnalysis.cpp index 42ebb4b3be5..bef7653c05d 100644 --- a/lib/CodeGen/LiveIntervalAnalysis.cpp +++ b/lib/CodeGen/LiveIntervalAnalysis.cpp @@ -109,17 +109,13 @@ bool LiveIntervals::runOnMachineFunction(MachineFunction &fn) { const MachineBasicBlock* mbb = mbbi; unsigned loopDepth = loopInfo.getLoopDepth(mbb->getBasicBlock()); - if (loopDepth) { - for (MachineBasicBlock::const_iterator mii = mbb->begin(), - mie = mbb->end(); mii != mie; ++mii) { - MachineInstr* mi = *mii; - - for (int i = mi->getNumOperands() - 1; i >= 0; --i) { - MachineOperand& mop = mi->getOperand(i); - - if (!mop.isVirtualRegister()) - continue; + for (MachineBasicBlock::const_iterator mii = mbb->begin(), + mie = mbb->end(); mii != mie; ++mii) { + MachineInstr* mi = *mii; + for (int i = mi->getNumOperands() - 1; i >= 0; --i) { + MachineOperand& mop = mi->getOperand(i); + if (mop.isVirtualRegister()) { unsigned reg = mop.getAllocatedRegNum(); Reg2IntervalMap::iterator r2iit = r2iMap_.find(reg); assert(r2iit != r2iMap_.end());