diff options
author | Chris Lattner <sabre@nondot.org> | 2010-11-30 00:12:39 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-11-30 00:12:39 +0000 |
commit | c3c754f75068a5fcc21ca6d622ed52a67bf1e89a (patch) | |
tree | a94a6112eba7a161693aed68c26711f9b91a7773 /llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp | |
parent | 49408cef39b3d7727dba5ce32f623ddb0c2d2a41 (diff) | |
download | bcm5719-llvm-c3c754f75068a5fcc21ca6d622ed52a67bf1e89a.tar.gz bcm5719-llvm-c3c754f75068a5fcc21ca6d622ed52a67bf1e89a.zip |
my previous patch would cause us to start deleting some volatile
stores, fix and add a testcase.
llvm-svn: 120363
Diffstat (limited to 'llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp')
-rw-r--r-- | llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp b/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp index e1d89cb9109..dd66416e7fe 100644 --- a/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp +++ b/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp @@ -222,7 +222,7 @@ bool DSE::runOnBasicBlock(BasicBlock &BB) { if (StoreInst *SI = dyn_cast<StoreInst>(Inst)) { if (LoadInst *DepLoad = dyn_cast<LoadInst>(InstDep.getInst())) { if (SI->getPointerOperand() == DepLoad->getPointerOperand() && - SI->getOperand(0) == DepLoad) { + SI->getOperand(0) == DepLoad && !SI->isVolatile()) { // DeleteDeadInstruction can delete the current instruction. Save BBI // in case we need it. WeakVH NextInst(BBI); |