Only remove the edge from entry to false if false block is merged.
authorEvan Cheng <evan.cheng@apple.com>
Thu, 7 Jun 2007 22:31:28 +0000 (22:31 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Thu, 7 Jun 2007 22:31:28 +0000 (22:31 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37503 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/IfConversion.cpp

index 64f2faf09de0bba4d5e240c6edb6a4a0ccb1de96..2b03abecb99be20211cae0aad0b5ba093cebdb47 100644 (file)
@@ -647,8 +647,8 @@ bool IfConverter::IfConvertTriangle(BBInfo &BBI) {
   // Now merge the entry of the triangle with the true block.
   BBI.NonPredSize -= TII->RemoveBranch(*BBI.BB);
   MergeBlocks(BBI, TrueBBI);
-  // Remove entry to false edge.
-  if (BBI.BB->isSuccessor(FalseBBI.BB))
+  // Remove entry to false edge if false block is merged in as well.
+  if (FalseBBDead && BBI.BB->isSuccessor(FalseBBI.BB))
     BBI.BB->removeSuccessor(FalseBBI.BB);
   std::copy(BBI.BrCond.begin(), BBI.BrCond.end(),
             std::back_inserter(BBI.Predicate));