summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-11-28 22:50:08 +0000
committerChris Lattner <sabre@nondot.org>2008-11-28 22:50:08 +0000
commitf3f6a801ccc5b5aeae286d5958b1be426f03e298 (patch)
treed9989a123d6d0d81053ee93007b13f92a4ddf71a /llvm/lib
parent08f3c005625a8af83dd9d2b05bb8c258cd693d5c (diff)
downloadbcm5719-llvm-f3f6a801ccc5b5aeae286d5958b1be426f03e298.tar.gz
bcm5719-llvm-f3f6a801ccc5b5aeae286d5958b1be426f03e298.zip
don't revisit instructions off the beginning of the block.
llvm-svn: 60221
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp b/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
index b48bbeae66b..e6a05b7e90b 100644
--- a/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
+++ b/llvm/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
OpenPOWER on IntegriCloud