diff options
| author | Benjamin Kramer <benny.kra@googlemail.com> | 2010-06-13 14:35:54 +0000 |
|---|---|---|
| committer | Benjamin Kramer <benny.kra@googlemail.com> | 2010-06-13 14:35:54 +0000 |
| commit | b82de426dee23c2c3b7e623f42166efff5b9751e (patch) | |
| tree | 782fcf96f1352623f22439e9ef8d7fab49ae76f3 /llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp | |
| parent | c49ea3c50e749f690853ce9ab7ade71f090ec473 (diff) | |
| download | bcm5719-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.cpp | 3 |
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) || |

