From: Chris Lattner Date: Sun, 7 Dec 2008 00:25:15 +0000 (+0000) Subject: don't bother touching volatile stores, they will just return clobber on X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=f760be1c7fd793e103f788687e4efdcad2464b58;p=oota-llvm.git don't bother touching volatile stores, they will just return clobber on everything interesting anyway. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60640 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Scalar/DeadStoreElimination.cpp b/lib/Transforms/Scalar/DeadStoreElimination.cpp index 92431c3fe31..8b40da656ee 100644 --- a/lib/Transforms/Scalar/DeadStoreElimination.cpp +++ b/lib/Transforms/Scalar/DeadStoreElimination.cpp @@ -90,6 +90,11 @@ bool DSE::runOnBasicBlock(BasicBlock &BB) { // If we find a store or a free, get it's memory dependence. if (!isa(Inst) && !isa(Inst)) continue; + + // Don't molest volatile stores or do queries that will return "clobber". + if (StoreInst *SI = dyn_cast(Inst)) + if (SI->isVolatile()) + continue; MemDepResult InstDep = MD.getDependency(Inst);