summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2010-06-07 21:28:55 +0000
committerJim Grosbach <grosbach@apple.com>2010-06-07 21:28:55 +0000
commit6201b991a2a44d42ba701219d667cec9cdd7b29d (patch)
tree051a83adffb525bbc123e178383c7e33606208c8 /llvm/lib
parent22e1adbb11b974610323d4146fef233eb43c5e79 (diff)
downloadbcm5719-llvm-6201b991a2a44d42ba701219d667cec9cdd7b29d.tar.gz
bcm5719-llvm-6201b991a2a44d42ba701219d667cec9cdd7b29d.zip
Cleanup. Process the dbg_values separately
llvm-svn: 105554
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/IfConversion.cpp34
1 files changed, 16 insertions, 18 deletions
diff --git a/llvm/lib/CodeGen/IfConversion.cpp b/llvm/lib/CodeGen/IfConversion.cpp
index 2e630f71d60..7fa07daf9ca 100644
--- a/llvm/lib/CodeGen/IfConversion.cpp
+++ b/llvm/lib/CodeGen/IfConversion.cpp
@@ -514,15 +514,14 @@ bool IfConverter::ValidDiamond(BBInfo &TrueBBI, BBInfo &FalseBBI,
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 @@ bool IfConverter::ValidDiamond(BBInfo &TrueBBI, BBInfo &FalseBBI,
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;
OpenPOWER on IntegriCloud