No really, clear predcessors states.
authorEvan Cheng <evan.cheng@apple.com>
Thu, 14 Jun 2007 23:34:09 +0000 (23:34 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Thu, 14 Jun 2007 23:34:09 +0000 (23:34 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37581 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/IfConversion.cpp

index b1aa31a28e3d8f84612e66bc61775468ac43ffb4..416c76047741c5308683e6ce3e24787a0c875e7a 100644 (file)
@@ -662,13 +662,11 @@ void IfConverter::ReTryPreds(MachineBasicBlock *BB) {
   for (MachineBasicBlock::pred_iterator PI = BB->pred_begin(),
          E = BB->pred_end(); PI != E; ++PI) {
     BBInfo &PBBI = BBAnalysis[(*PI)->getNumber()];
-    if (PBBI.IsDone)
+    if (PBBI.IsDone || PBBI.BB == BB)
       continue;
-    if (PBBI.Kind == ICNotClassfied) {
-      assert(!PBBI.IsEnqueued && "Unexpected");
-      PBBI.IsAnalyzed = false;
-    } else if (PBBI.IsEnqueued && PBBI.BB != BB)
-      PBBI.IsEnqueued = false;
+    PBBI.Kind = ICNotClassfied;
+    PBBI.IsAnalyzed = false;
+    PBBI.IsEnqueued = false;
   }
 }
 
@@ -769,8 +767,11 @@ bool IfConverter::IfConvertTriangle(BBInfo &BBI) {
       if (PBB == BBI.BB)
         continue;
       BBInfo &PBBI = BBAnalysis[PBB->getNumber()];
-      if (PBBI.IsEnqueued)
+      if (PBBI.IsEnqueued) {
+        PBBI.Kind = ICNotClassfied;
+        PBBI.IsAnalyzed = false;
         PBBI.IsEnqueued = false;
+      }
     }
   }