- Fix bug: cee/2002-10-07-NoImmediateDominator.ll
authorChris Lattner <sabre@nondot.org>
Tue, 8 Oct 2002 21:53:51 +0000 (21:53 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 8 Oct 2002 21:53:51 +0000 (21:53 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4081 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/BreakCriticalEdges.cpp
lib/Transforms/Utils/BreakCriticalEdges.cpp

index b73ed55b8c9935b7a884bd79e6e51e8b4307b866..0c4974db10ac4c325d94ceb981ace69ec4e5d53a 100644 (file)
@@ -118,7 +118,8 @@ void SplitCriticalEdge(TerminatorInst *TI, unsigned SuccNum, Pass *P) {
     // The new block is not the immediate dominator for any other nodes, but
     // TINode is the immediate dominator for the new node.
     //
-    DT->createNewNode(NewBB, TINode);
+    if (TINode)        // Don't break unreachable code!
+      DT->createNewNode(NewBB, TINode);
   }
 }
 
index b73ed55b8c9935b7a884bd79e6e51e8b4307b866..0c4974db10ac4c325d94ceb981ace69ec4e5d53a 100644 (file)
@@ -118,7 +118,8 @@ void SplitCriticalEdge(TerminatorInst *TI, unsigned SuccNum, Pass *P) {
     // The new block is not the immediate dominator for any other nodes, but
     // TINode is the immediate dominator for the new node.
     //
-    DT->createNewNode(NewBB, TINode);
+    if (TINode)        // Don't break unreachable code!
+      DT->createNewNode(NewBB, TINode);
   }
 }