OSDN Git Service

Don't remove volatile loads. Thanks to Duncan for noticing this one.
authorOwen Anderson <resistor@mac.com>
Mon, 28 Jul 2008 20:52:42 +0000 (20:52 +0000)
committerOwen Anderson <resistor@mac.com>
Mon, 28 Jul 2008 20:52:42 +0000 (20:52 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54144 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/DeadStoreElimination.cpp

index 0011d95..b75d5c4 100644 (file)
@@ -183,7 +183,7 @@ bool DSE::runOnBasicBlock(BasicBlock &BB) {
         Instruction* dep = MD.getDependency(S);
         DominatorTree& DT = getAnalysis<DominatorTree>();
         
-        if (S->getParent() == L->getParent() &&
+        if (!S->isVolatile() && S->getParent() == L->getParent() &&
             S->getPointerOperand() == L->getPointerOperand() &&
             ( dep == MemoryDependenceAnalysis::None ||
               dep == MemoryDependenceAnalysis::NonLocal ||