[llvm-commits] CVS: llvm/lib/CodeGen/IfConversion.cpp

Evan Cheng evan.cheng at apple.com
Fri Jun 8 12:17:34 PDT 2007



Changes in directory llvm/lib/CodeGen:

IfConversion.cpp updated: 1.39 -> 1.40
---
Log message:

Correct transfer predicate information.

---
Diffs of the changes:  (+6 -8)

 IfConversion.cpp |   14 ++++++--------
 1 files changed, 6 insertions(+), 8 deletions(-)


Index: llvm/lib/CodeGen/IfConversion.cpp
diff -u llvm/lib/CodeGen/IfConversion.cpp:1.39 llvm/lib/CodeGen/IfConversion.cpp:1.40
--- llvm/lib/CodeGen/IfConversion.cpp:1.39	Fri Jun  8 14:10:51 2007
+++ llvm/lib/CodeGen/IfConversion.cpp	Fri Jun  8 14:17:12 2007
@@ -610,7 +610,6 @@
     // available if cmp executes.
     IterIfcvt = false;
   }
-  std::copy(Cond.begin(), Cond.end(), std::back_inserter(BBI.Predicate));
 
   // Update block info. BB can be iteratively if-converted.
   if (IterIfcvt)
@@ -671,8 +670,6 @@
   // Remove entry to false edge if false block is merged in as well.
   if (FalseBBDead)
     BBI.BB->removeSuccessor(FalseBBI.BB);
-  std::copy(BBI.BrCond.begin(), BBI.BrCond.end(),
-            std::back_inserter(BBI.Predicate));
 
   // Update block info. BB can be iteratively if-converted.
   if (IterIfcvt) 
@@ -785,11 +782,6 @@
 
   // Merge the combined block into the entry of the diamond.
   MergeBlocks(BBI, *BBI1);
-  std::copy(Cond1->begin(), Cond1->end(),
-            std::back_inserter(BBI.Predicate));
-  if (!NeedBr1)
-    std::copy(Cond2->begin(), Cond2->end(),
-              std::back_inserter(BBI.Predicate));
 
   // 'True' and 'false' aren't combined, see if we need to add a unconditional
   // branch to the 'false' block.
@@ -837,6 +829,8 @@
   }
 
   BBI.NonPredSize = 0;
+  std::copy(Cond.begin(), Cond.end(), std::back_inserter(BBI.Predicate));
+
   NumIfConvBBs++;
 }
 
@@ -883,4 +877,8 @@
 
   ToBBI.ModifyPredicate |= FromBBI.ModifyPredicate;
   ToBBI.hasFallThrough = FromBBI.hasFallThrough;
+
+  std::copy(FromBBI.Predicate.begin(), FromBBI.Predicate.end(),
+            std::back_inserter(ToBBI.Predicate));
+  FromBBI.Predicate.clear();
 }






More information about the llvm-commits mailing list