[llvm-branch-commits] [llvm-branch] r105499 - in /llvm/branches/Apple/Troughton: ./ lib/CodeGen/IfConversion.cpp

Jim Grosbach grosbach at apple.com
Fri Jun 4 16:04:02 PDT 2010


Author: grosbach
Date: Fri Jun  4 18:04:01 2010
New Revision: 105499

URL: http://llvm.org/viewvc/llvm-project?rev=105499&view=rev
Log:
merge 105498

Modified:
    llvm/branches/Apple/Troughton/   (props changed)
    llvm/branches/Apple/Troughton/lib/CodeGen/IfConversion.cpp

Propchange: llvm/branches/Apple/Troughton/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jun  4 18:04:01 2010
@@ -1 +1 @@
-/llvm/trunk:105358,105361,105369,105372,105399,105427,105437,105439,105441,105470,105481
+/llvm/trunk:105358,105361,105369,105372,105399,105427,105437,105439,105441,105470,105481,105498

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=105499&r1=105498&r2=105499&view=diff
==============================================================================
--- llvm/branches/Apple/Troughton/lib/CodeGen/IfConversion.cpp (original)
+++ llvm/branches/Apple/Troughton/lib/CodeGen/IfConversion.cpp Fri Jun  4 18:04:01 2010
@@ -514,7 +514,15 @@
 
   MachineBasicBlock::iterator TI = TrueBBI.BB->begin();
   MachineBasicBlock::iterator FI = FalseBBI.BB->begin();
-  while (TI != TrueBBI.BB->end() && FI != FalseBBI.BB->end()) {
+  while (1) {
+    // Skip dbg_value instructions
+    if (TI->isDebugValue())
+      ++TI;
+    if (FI->isDebugValue())
+      ++FI;
+    if (TI == TrueBBI.BB->end() || FI == FalseBBI.BB->end())
+      break;
+
     if (!TI->isIdenticalTo(FI))
       break;
     ++Dups1;
@@ -524,7 +532,15 @@
 
   TI = firstNonBranchInst(TrueBBI.BB, TII);
   FI = firstNonBranchInst(FalseBBI.BB, TII);
-  while (TI != TrueBBI.BB->begin() && FI != FalseBBI.BB->begin()) {
+  while (1) {
+    // Skip dbg_value instructions
+    if (TI->isDebugValue())
+      --TI;
+    if (FI->isDebugValue())
+      --FI;
+    if (TI == TrueBBI.BB->begin() || FI == FalseBBI.BB->begin())
+      break;
+
     if (!TI->isIdenticalTo(FI))
       break;
     ++Dups2;
@@ -569,6 +585,9 @@
   BBI.ClobbersPred = false;
   for (MachineBasicBlock::iterator I = BBI.BB->begin(), E = BBI.BB->end();
        I != E; ++I) {
+    if (I->isDebugValue())
+      continue;
+
     const TargetInstrDesc &TID = I->getDesc();
     if (TID.isNotDuplicable())
       BBI.CannotBeCopied = true;
@@ -1137,7 +1156,7 @@
                                  MachineBasicBlock::iterator E,
                                  SmallVectorImpl<MachineOperand> &Cond) {
   for (MachineBasicBlock::iterator I = BBI.BB->begin(); I != E; ++I) {
-    if (TII->isPredicated(I))
+    if (I->isDebugValue() || TII->isPredicated(I))
       continue;
     if (!TII->PredicateInstruction(I, Cond)) {
 #ifndef NDEBUG
@@ -1174,7 +1193,7 @@
     ToBBI.BB->insert(ToBBI.BB->end(), MI);
     ToBBI.NonPredSize++;
 
-    if (!isPredicated)
+    if (!isPredicated && !MI->isDebugValue())
       if (!TII->PredicateInstruction(MI, Cond)) {
 #ifndef NDEBUG
         dbgs() << "Unable to predicate " << *I << "!\n";





More information about the llvm-branch-commits mailing list