Do not delete dead invoke instructions!
authorChris Lattner <sabre@nondot.org>
Tue, 16 Nov 2004 16:32:28 +0000 (16:32 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 16 Nov 2004 16:32:28 +0000 (16:32 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17897 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/SCCP.cpp

index 603a52b235869427df708dc24ba9f48166262ad4..fcb508f95159a2ff4c60713b370c9f7575130008 100644 (file)
@@ -875,7 +875,7 @@ bool SCCP::runOnFunction(Function &F) {
       Instruction *Inst = BI++;
       if (Inst->getType() != Type::VoidTy) {
         LatticeVal &IV = Values[Inst];
-        if (IV.isConstant() || IV.isUndefined()) {
+        if (IV.isConstant() || IV.isUndefined() && !isa<TerminatorInst>(Inst)) {
           Constant *Const;
           if (IV.isConstant()) {
             Const = IV.getConstant();
@@ -900,4 +900,3 @@ bool SCCP::runOnFunction(Function &F) {
 
   return MadeChanges;
 }
-