summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2010-06-13 14:35:54 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2010-06-13 14:35:54 +0000
commitb82de426dee23c2c3b7e623f42166efff5b9751e (patch)
tree782fcf96f1352623f22439e9ef8d7fab49ae76f3 /llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp
parentc49ea3c50e749f690853ce9ab7ade71f090ec473 (diff)
downloadbcm5719-llvm-b82de426dee23c2c3b7e623f42166efff5b9751e.tar.gz
bcm5719-llvm-b82de426dee23c2c3b7e623f42166efff5b9751e.zip
SimplifyCFG: don't turn volatile stores to null/undef into unreachable. Fixes PR7369.
llvm-svn: 105914
Diffstat (limited to 'llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp b/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp
index 97441008c46..49d93a2fcc2 100644
--- a/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp
+++ b/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp
@@ -137,6 +137,9 @@ static bool MarkAliveBlocks(BasicBlock *BB,
// they should be changed to unreachable by passes that can't modify the
// CFG.
if (StoreInst *SI = dyn_cast<StoreInst>(BBI)) {
+ // Don't touch volatile stores.
+ if (SI->isVolatile()) continue;
+
Value *Ptr = SI->getOperand(1);
if (isa<UndefValue>(Ptr) ||
OpenPOWER on IntegriCloud