[llvm-commits] [llvm] r105554 - /llvm/trunk/lib/CodeGen/IfConversion.cpp
Jim Grosbach
grosbach at apple.com
Mon Jun 7 14:28:55 PDT 2010
Author: grosbach
Date: Mon Jun 7 16:28:55 2010
New Revision: 105554
URL: http://llvm.org/viewvc/llvm-project?rev=105554&view=rev
Log:
Cleanup. Process the dbg_values separately
Modified:
llvm/trunk/lib/CodeGen/IfConversion.cpp
Modified: llvm/trunk/lib/CodeGen/IfConversion.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/IfConversion.cpp?rev=105554&r1=105553&r2=105554&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/IfConversion.cpp (original)
+++ llvm/trunk/lib/CodeGen/IfConversion.cpp Mon Jun 7 16:28:55 2010
@@ -514,15 +514,14 @@
MachineBasicBlock::iterator TI = TrueBBI.BB->begin();
MachineBasicBlock::iterator FI = FalseBBI.BB->begin();
- while (1) {
- if (TI == TrueBBI.BB->end() || FI == FalseBBI.BB->end())
- break;
- // Skip dbg_value instructions
- if (TI->isDebugValue())
- ++TI;
- if (FI->isDebugValue())
- ++FI;
-
+ MachineBasicBlock::iterator TIE = TrueBBI.BB->end();
+ MachineBasicBlock::iterator FIE = FalseBBI.BB->end();
+ // Skip dbg_value instructions
+ while (TI != TIE && TI->isDebugValue())
+ ++TI;
+ while (FI != FIE && FI->isDebugValue())
+ ++FI;
+ while (TI != TIE && FI != FIE) {
if (!TI->isIdenticalTo(FI))
break;
++Dups1;
@@ -532,15 +531,14 @@
TI = firstNonBranchInst(TrueBBI.BB, TII);
FI = firstNonBranchInst(FalseBBI.BB, TII);
- while (1) {
- if (TI == TrueBBI.BB->begin() || FI == FalseBBI.BB->begin())
- break;
- // Skip dbg_value instructions
- if (TI->isDebugValue())
- --TI;
- if (FI->isDebugValue())
- --FI;
-
+ MachineBasicBlock::iterator TIB = TrueBBI.BB->begin();
+ MachineBasicBlock::iterator FIB = FalseBBI.BB->begin();
+ // Skip dbg_value instructions
+ while (TI != TIB && TI->isDebugValue())
+ --TI;
+ while (FI != FIB && FI->isDebugValue())
+ --FI;
+ while (TI != TIB && FI != FIB) {
if (!TI->isIdenticalTo(FI))
break;
++Dups2;
More information about the llvm-commits
mailing list