diff options
author | Dale Johannesen <dalej@apple.com> | 2010-02-10 01:31:26 +0000 |
---|---|---|
committer | Dale Johannesen <dalej@apple.com> | 2010-02-10 01:31:26 +0000 |
commit | 1d0aeabe3fce2ce6610e988b36582b47a7684f74 (patch) | |
tree | 6f3077a2930b383b2ddfc316e528a755623536da /lib/CodeGen/LiveIntervalAnalysis.cpp | |
parent | 45282aedb9c5a33d20565502c6c8fc871fa84cbe (diff) | |
download | external_llvm-1d0aeabe3fce2ce6610e988b36582b47a7684f74.zip external_llvm-1d0aeabe3fce2ce6610e988b36582b47a7684f74.tar.gz external_llvm-1d0aeabe3fce2ce6610e988b36582b47a7684f74.tar.bz2 |
Rewrite loop to suit Chris' preference.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95749 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/LiveIntervalAnalysis.cpp')
-rw-r--r-- | lib/CodeGen/LiveIntervalAnalysis.cpp | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/lib/CodeGen/LiveIntervalAnalysis.cpp b/lib/CodeGen/LiveIntervalAnalysis.cpp index efc050e..432409a 100644 --- a/lib/CodeGen/LiveIntervalAnalysis.cpp +++ b/lib/CodeGen/LiveIntervalAnalysis.cpp @@ -611,23 +611,26 @@ void LiveIntervals::handleLiveInRegister(MachineBasicBlock *MBB, MachineBasicBlock::iterator E = MBB->end(); while (mi != E) { - if (!mi->isDebugValue()) { - if (mi->killsRegister(interval.reg, tri_)) { - DEBUG(dbgs() << " killed"); - end = baseIndex.getDefIndex(); - SeenDefUse = true; - break; - } else if (mi->modifiesRegister(interval.reg, tri_)) { - // Another instruction redefines the register before it is ever read. - // Then the register is essentially dead at the instruction that defines - // it. Hence its interval is: - // [defSlot(def), defSlot(def)+1) - DEBUG(dbgs() << " dead"); - end = start.getStoreIndex(); - SeenDefUse = true; - break; - } + if (mi->isDebugValue()) { + ++mi; + continue; + } + if (mi->killsRegister(interval.reg, tri_)) { + DEBUG(dbgs() << " killed"); + end = baseIndex.getDefIndex(); + SeenDefUse = true; + break; + } else if (mi->modifiesRegister(interval.reg, tri_)) { + // Another instruction redefines the register before it is ever read. + // Then the register is essentially dead at the instruction that defines + // it. Hence its interval is: + // [defSlot(def), defSlot(def)+1) + DEBUG(dbgs() << " dead"); + end = start.getStoreIndex(); + SeenDefUse = true; + break; } + ++mi; if (mi != E && !mi->isDebugValue()) { baseIndex = indexes_->getNextNonNullIndex(baseIndex); |