diff --git a/lib/Transforms/Scalar/DeadStoreElimination.cpp b/lib/Transforms/Scalar/DeadStoreElimination.cpp index 7e2588ab77d..ba0d1bdf2bd 100644 --- a/lib/Transforms/Scalar/DeadStoreElimination.cpp +++ b/lib/Transforms/Scalar/DeadStoreElimination.cpp @@ -420,7 +420,7 @@ bool DSE::handleEndBlock(BasicBlock& BB, } else { // For any non-memory-affecting non-terminators, DCE them as we reach them Instruction *CI = BBI; - if (!CI->isTerminator() && CI->getNumUses() == 0) { + if (!CI->isTerminator() && CI->getNumUses() == 0 && !isa(CI)) { // DCE instructions only used to calculate that load for (Instruction::op_iterator OI = CI->op_begin(), OE = CI->op_end();