diff options
author | Chris Lattner <sabre@nondot.org> | 2009-01-14 21:01:16 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-01-14 21:01:16 +0000 |
commit | 8fb9480ed26693dc8f8053b6345bdd188041d41b (patch) | |
tree | afa66e98780f8fdeb88c9b9f3e271857e85ea79e /llvm/lib/Transforms/Scalar/SCCP.cpp | |
parent | 08e5e62f98ea015e52038b9c6d36d7bd59626541 (diff) | |
download | bcm5719-llvm-8fb9480ed26693dc8f8053b6345bdd188041d41b.tar.gz bcm5719-llvm-8fb9480ed26693dc8f8053b6345bdd188041d41b.zip |
Fix PR3325, a miscompilation of invokes by IPSCCP. Patch by Jay Foad!
llvm-svn: 62244
Diffstat (limited to 'llvm/lib/Transforms/Scalar/SCCP.cpp')
-rw-r--r-- | llvm/lib/Transforms/Scalar/SCCP.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Scalar/SCCP.cpp b/llvm/lib/Transforms/Scalar/SCCP.cpp index 954bc0011e6..dfb47954591 100644 --- a/llvm/lib/Transforms/Scalar/SCCP.cpp +++ b/llvm/lib/Transforms/Scalar/SCCP.cpp @@ -1749,8 +1749,7 @@ bool IPSCCP::runOnModule(Module &M) { } else { for (BasicBlock::iterator BI = BB->begin(), E = BB->end(); BI != E; ) { Instruction *Inst = BI++; - if (Inst->getType() == Type::VoidTy || - isa<TerminatorInst>(Inst)) + if (Inst->getType() == Type::VoidTy) continue; LatticeVal &IV = Values[Inst]; @@ -1766,7 +1765,7 @@ bool IPSCCP::runOnModule(Module &M) { Inst->replaceAllUsesWith(Const); // Delete the instruction. - if (!isa<CallInst>(Inst)) + if (!isa<CallInst>(Inst) && !isa<TerminatorInst>(Inst)) Inst->eraseFromParent(); // Hey, we just changed something! |