summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-12-07 00:25:15 +0000
committerChris Lattner <sabre@nondot.org>2008-12-07 00:25:15 +0000
commit5df5b4cc2eca2e8437b7b821d553fde9151b1fed (patch)
tree8f5193147203a52f61eab5eb22f5bc2608404bf7 /llvm/lib/Transforms
parentf5891941b46720a530bcc6041142e451b5f4dde7 (diff)
downloadbcm5719-llvm-5df5b4cc2eca2e8437b7b821d553fde9151b1fed.tar.gz
bcm5719-llvm-5df5b4cc2eca2e8437b7b821d553fde9151b1fed.zip
don't bother touching volatile stores, they will just return clobber on
everything interesting anyway. llvm-svn: 60640
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp b/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
index 92431c3fe31..8b40da656ee 100644
--- a/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
+++ b/llvm/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);
OpenPOWER on IntegriCloud