Fix some stupid bugs that have effectively disabled if-conversion.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37575 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/IfConversion.cpp b/lib/CodeGen/IfConversion.cpp
index 02fbfee..40a7143 100644
--- a/lib/CodeGen/IfConversion.cpp
+++ b/lib/CodeGen/IfConversion.cpp
@@ -208,6 +208,7 @@
       // marked dead (due to it being predicated), then skip it.
       if (!BBI.IsEnqueued || BBI.IsDone)
         continue;
+      BBI.IsEnqueued = false;
 
       bool RetVal = false;
       switch (BBI.Kind) {
@@ -625,6 +626,7 @@
         case ICTriangleFalse:
         case ICTriangleFRev:
         case ICDiamond:
+          BBI.IsEnqueued = true;
           Candidates.push_back(&BBI);
           break;
         default:
@@ -660,7 +662,7 @@
          E = BB->pred_end(); PI != E; ++PI) {
     BBInfo &PBBI = BBAnalysis[(*PI)->getNumber()];
     if (!PBBI.IsDone && PBBI.Kind == ICNotClassfied) {
-      assert(PBBI.IsEnqueued && "Unexpected");
+      assert(!PBBI.IsEnqueued && "Unexpected");
       PBBI.IsAnalyzed = false;
     }
   }
@@ -963,6 +965,7 @@
     }
   }
 
+  BBI.IsAnalyzed = false;
   BBI.NonPredSize = 0;
   std::copy(Cond.begin(), Cond.end(), std::back_inserter(BBI.Predicate));
 
@@ -1013,4 +1016,7 @@
   std::copy(FromBBI.Predicate.begin(), FromBBI.Predicate.end(),
             std::back_inserter(ToBBI.Predicate));
   FromBBI.Predicate.clear();
+
+  ToBBI.IsAnalyzed = false;
+  FromBBI.IsAnalyzed = false;
 }