From f760be1c7fd793e103f788687e4efdcad2464b58 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 7 Dec 2008 00:25:15 +0000 Subject: [PATCH] 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 --- lib/Transforms/Scalar/DeadStoreElimination.cpp | 5 +++++ 1 file changed, 5 insertions(+) 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); -- 2.34.1