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 | f8b0e445848f3de315fc0cb76a2b9ab673b3f53e (patch) | |
tree | da9cfce8bd0ccc2fe41738b4328c77f50edd0c9f /llvm/lib/CodeGen | |
parent | ea26fa99716dbe0f3fa28dedba646d225a6ea8d4 (diff) | |
download | bcm5719-llvm-f8b0e445848f3de315fc0cb76a2b9ab673b3f53e.tar.gz bcm5719-llvm-f8b0e445848f3de315fc0cb76a2b9ab673b3f53e.zip |
Rewrite loop to suit Chris' preference.
llvm-svn: 95749
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/LiveIntervalAnalysis.cpp | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp index efc050e061b..432409acd32 100644 --- a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp +++ b/llvm/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); |