[llvm-commits] [llvm] r54144 - /llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp

Owen Anderson resistor at mac.com
Mon Jul 28 13:52:42 PDT 2008


Author: resistor
Date: Mon Jul 28 15:52:42 2008
New Revision: 54144

URL: http://llvm.org/viewvc/llvm-project?rev=54144&view=rev
Log:
Don't remove volatile loads.  Thanks to Duncan for noticing this one.

Modified:
    llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp

Modified: llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp?rev=54144&r1=54143&r2=54144&view=diff

==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp Mon Jul 28 15:52:42 2008
@@ -183,7 +183,7 @@
         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 ||





More information about the llvm-commits mailing list