diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2009-12-03 20:49:10 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2009-12-03 20:49:10 +0000 |
commit | f4811a96941433fc3828869d76dfeba5ec5decd3 (patch) | |
tree | e0c045f84f66e88a2f0b146b05fae0f96c4e614c /lib | |
parent | 5d11eb0ed54116b7f33507999617661fb2ae99df (diff) | |
download | external_llvm-f4811a96941433fc3828869d76dfeba5ec5decd3.zip external_llvm-f4811a96941433fc3828869d76dfeba5ec5decd3.tar.gz external_llvm-f4811a96941433fc3828869d76dfeba5ec5decd3.tar.bz2 |
Clean up some loop logic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90481 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CodeGen/LiveIntervalAnalysis.cpp | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/lib/CodeGen/LiveIntervalAnalysis.cpp b/lib/CodeGen/LiveIntervalAnalysis.cpp index 3c1d4b3..35337ef 100644 --- a/lib/CodeGen/LiveIntervalAnalysis.cpp +++ b/lib/CodeGen/LiveIntervalAnalysis.cpp @@ -159,12 +159,10 @@ bool LiveIntervals::conflictsWithPhysRegDef(const LiveInterval &li, end = I->end.getPrevSlot().getBaseIndex().getNextIndex(); index != end; index = index.getNextIndex()) { - // skip deleted instructions - while (index != end && !getInstructionFromIndex(index)) - index = index.getNextIndex(); - if (index == end) break; - MachineInstr *MI = getInstructionFromIndex(index); + if (!MI) + continue; // skip deleted instructions + unsigned SrcReg, DstReg, SrcSubReg, DstSubReg; if (tii_->isMoveInstr(*MI, SrcReg, DstReg, SrcSubReg, DstSubReg)) if (SrcReg == li.reg || DstReg == li.reg) @@ -201,15 +199,9 @@ bool LiveIntervals::conflictsWithPhysRegRef(LiveInterval &li, end = I->end.getPrevSlot().getBaseIndex().getNextIndex(); index != end; index = index.getNextIndex()) { - // Skip deleted instructions. - MachineInstr *MI = 0; - while (index != end) { - MI = getInstructionFromIndex(index); - if (MI) - break; - index = index.getNextIndex(); - } - if (index == end) break; + MachineInstr *MI = getInstructionFromIndex(index); + if (!MI) + continue; // skip deleted instructions if (JoinedCopies.count(MI)) continue; |