diff --git a/lib/Transforms/Scalar/DeadStoreElimination.cpp b/lib/Transforms/Scalar/DeadStoreElimination.cpp index 0011d9566e3..b75d5c4be7e 100644 --- a/lib/Transforms/Scalar/DeadStoreElimination.cpp +++ b/lib/Transforms/Scalar/DeadStoreElimination.cpp @@ -183,7 +183,7 @@ bool DSE::runOnBasicBlock(BasicBlock &BB) { Instruction* dep = MD.getDependency(S); DominatorTree& DT = getAnalysis(); - if (S->getParent() == L->getParent() && + if (!S->isVolatile() && S->getParent() == L->getParent() && S->getPointerOperand() == L->getPointerOperand() && ( dep == MemoryDependenceAnalysis::None || dep == MemoryDependenceAnalysis::NonLocal ||