diff options
author | Chris Lattner <sabre@nondot.org> | 2008-11-28 22:50:08 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-11-28 22:50:08 +0000 |
commit | 5425f22fa3f8cbbcbc1a76fc7df2fa251cdc132d (patch) | |
tree | 8c56e739ec50ade90c7cbadba1bf6b054c25726a /lib/Transforms/Scalar/DeadStoreElimination.cpp | |
parent | 956033a4f5de491fcc07bc3ef0700ad22fd836a0 (diff) | |
download | llvm-5425f22fa3f8cbbcbc1a76fc7df2fa251cdc132d.tar.gz llvm-5425f22fa3f8cbbcbc1a76fc7df2fa251cdc132d.tar.bz2 llvm-5425f22fa3f8cbbcbc1a76fc7df2fa251cdc132d.tar.xz |
don't revisit instructions off the beginning of the block.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60221 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/DeadStoreElimination.cpp')
-rw-r--r-- | lib/Transforms/Scalar/DeadStoreElimination.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Transforms/Scalar/DeadStoreElimination.cpp b/lib/Transforms/Scalar/DeadStoreElimination.cpp index b48bbeae66..e6a05b7e90 100644 --- a/lib/Transforms/Scalar/DeadStoreElimination.cpp +++ b/lib/Transforms/Scalar/DeadStoreElimination.cpp @@ -132,7 +132,8 @@ bool DSE::runOnBasicBlock(BasicBlock &BB) { // If we deleted a store, reinvestigate this instruction. if (deletedStore) { - --BBI; + if (!isa<TerminatorInst>(BB.begin())) + --BBI; continue; } } @@ -160,7 +161,8 @@ bool DSE::runOnBasicBlock(BasicBlock &BB) { DT.dominates(dep, L))) { DeleteDeadInstruction(S); - --BBI; + if (!isa<TerminatorInst>(BB.begin())) + --BBI; NumFastStores++; MadeChange = true; } else |