Fix Analysis/Dominators/2006-10-02-BreakCritEdges.ll
authorChris Lattner <sabre@nondot.org>
Mon, 15 Jan 2007 00:15:09 +0000 (00:15 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 15 Jan 2007 00:15:09 +0000 (00:15 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33210 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Utils/BreakCriticalEdges.cpp

index e8cc027180cd1b5704988016ece56684d74fe296..adbf5847c4d88e5340e2ec6d84134d60669cb35b 100644 (file)
@@ -212,7 +212,8 @@ bool llvm::SplitCriticalEdge(TerminatorInst *TI, unsigned SuccNum, Pass *P,
 
   // Should we update ImmediateDominator information?
   if (ImmediateDominators *ID = P->getAnalysisToUpdate<ImmediateDominators>()) {
-    if (ID->get(TIBB)) {  // Only do this if TIBB is reachable.
+    // Only do this if TIBB is reachable.
+    if (ID->get(TIBB) || &TIBB->getParent()->getEntryBlock() == TIBB) {
       // TIBB is the new immediate dominator for NewBB.
       ID->addNewBlock(NewBB, TIBB);