diff options
| author | Chris Lattner <sabre@nondot.org> | 2010-11-29 21:59:31 +0000 | 
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2010-11-29 21:59:31 +0000 | 
| commit | 2e8793482c046e4330dafb6bd944680c90f768e8 (patch) | |
| tree | df8b9e94ba3877eb3a347377642a8fba14a226d2 /llvm/lib/Transforms | |
| parent | 43b0c6d94ffd7f82eb8d2278ec5a182fa109e962 (diff) | |
| download | bcm5719-llvm-2e8793482c046e4330dafb6bd944680c90f768e8.tar.gz bcm5719-llvm-2e8793482c046e4330dafb6bd944680c90f768e8.zip | |
fix PR8677, patch by Jakub Staszak!
llvm-svn: 120325
Diffstat (limited to 'llvm/lib/Transforms')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp | 6 | 
1 files changed, 4 insertions, 2 deletions
| diff --git a/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp b/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp index 02df1031e60..4540ccce8c6 100644 --- a/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp +++ b/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp @@ -235,8 +235,10 @@ bool DSE::runOnBasicBlock(BasicBlock &BB) {                                                  &BB);        } -      // If not a definite must-alias dependency, ignore it. -      if (!InstDep.isDef()) +      // If not a definite must-alias store dependency, ignore it.  If this is a +      // load from the same pointer, we don't want to transform load+store into +      // a noop. +      if (!InstDep.isDef() || !isa<StoreInst>(InstDep.getInst()))          continue;      } | 

