[llvm-branch-commits] [llvm-branch] r106326 - /llvm/branches/Apple/Troughton/lib/CodeGen/IfConversion.cpp

Evan Cheng evan.cheng at apple.com
Fri Jun 18 15:07:27 PDT 2010


Author: evancheng
Date: Fri Jun 18 17:07:27 2010
New Revision: 106326

URL: http://llvm.org/viewvc/llvm-project?rev=106326&view=rev
Log:
Merge 106323.

Modified:
    llvm/branches/Apple/Troughton/lib/CodeGen/IfConversion.cpp

Modified: llvm/branches/Apple/Troughton/lib/CodeGen/IfConversion.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Troughton/lib/CodeGen/IfConversion.cpp?rev=106326&r1=106325&r2=106326&view=diff
==============================================================================
--- llvm/branches/Apple/Troughton/lib/CodeGen/IfConversion.cpp (original)
+++ llvm/branches/Apple/Troughton/lib/CodeGen/IfConversion.cpp Fri Jun 18 17:07:27 2010
@@ -530,6 +530,19 @@
   while (FI != FIE && FI->isDebugValue())
     ++FI;
   while (TI != TIE && FI != FIE) {
+    // Skip dbg_value instructions. These do not count.
+    if (TI->isDebugValue()) {
+      while (TI != TIE && TI->isDebugValue())
+        ++TI;
+      if (TI == TIE)
+        break;
+    }
+    if (FI->isDebugValue()) {
+      while (FI != FIE && FI->isDebugValue())
+        ++FI;
+      if (FI == FIE)
+        break;
+    }
     if (!TI->isIdenticalTo(FI))
       break;
     ++Dups1;
@@ -541,12 +554,25 @@
   FI = firstNonBranchInst(FalseBBI.BB, TII);
   MachineBasicBlock::iterator TIB = TrueBBI.BB->begin();
   MachineBasicBlock::iterator FIB = FalseBBI.BB->begin();
-  // Skip dbg_value instructions
+  // Skip dbg_value instructions at end of the bb's.
   while (TI != TIB && TI->isDebugValue())
     --TI;
   while (FI != FIB && FI->isDebugValue())
     --FI;
   while (TI != TIB && FI != FIB) {
+    // Skip dbg_value instructions. These do not count.
+    if (TI->isDebugValue()) {
+      while (TI != TIB && TI->isDebugValue())
+        --TI;
+      if (TI == TIB)
+        break;
+    }
+    if (FI->isDebugValue()) {
+      while (FI != FIB && FI->isDebugValue())
+        --FI;
+      if (FI == FIB)
+        break;
+    }
     if (!TI->isIdenticalTo(FI))
       break;
     ++Dups2;





More information about the llvm-branch-commits mailing list