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 | 28efbb4e3494daecf0bfbf15c6bb180b2764ff83 (patch) | |
tree | ac5ca4aa415150a7d82d0dc64051991c88e27605 /lib | |
parent | ac55fa7d6cc03fba0063648755e6122fb5529701 (diff) | |
download | external_llvm-28efbb4e3494daecf0bfbf15c6bb180b2764ff83.zip external_llvm-28efbb4e3494daecf0bfbf15c6bb180b2764ff83.tar.gz external_llvm-28efbb4e3494daecf0bfbf15c6bb180b2764ff83.tar.bz2 |
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
Diffstat (limited to 'lib')
-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 92431c3..8b40da6 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); |