aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Scalar/SCCP.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Transforms/Scalar/SCCP.cpp')
-rw-r--r--lib/Transforms/Scalar/SCCP.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/Transforms/Scalar/SCCP.cpp b/lib/Transforms/Scalar/SCCP.cpp
index 954bc0011e..dfb4795459 100644
--- a/lib/Transforms/Scalar/SCCP.cpp
+++ b/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!