diff options
author | Chris Lattner <sabre@nondot.org> | 2008-12-07 00:25:15 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-12-07 00:25:15 +0000 |
commit | f760be1c7fd793e103f788687e4efdcad2464b58 (patch) | |
tree | ac5ca4aa415150a7d82d0dc64051991c88e27605 | |
parent | 84b9a56d11c119d2eadbc2ff4d56d33c25a07460 (diff) |
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
-rw-r--r-- | lib/Transforms/Scalar/DeadStoreElimination.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Transforms/Scalar/DeadStoreElimination.cpp b/lib/Transforms/Scalar/DeadStoreElimination.cpp index 92431c3fe3..8b40da656e 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<StoreInst>(Inst) && !isa<FreeInst>(Inst)) continue; + + // Don't molest volatile stores or do queries that will return "clobber". + if (StoreInst *SI = dyn_cast<StoreInst>(Inst)) + if (SI->isVolatile()) + continue; MemDepResult InstDep = MD.getDependency(Inst); |