summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2012-09-09 16:44:05 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2012-09-09 16:44:05 +0000
commit2b11eb072992994d631ec5de9ad2fa77dad31e7c (patch)
tree433271f61a290800b8f4ac046b95481dd1ed3e6b
parente9764d8f91931a3e1d2274237225101d7bb00533 (diff)
downloadbcm5719-llvm-2b11eb072992994d631ec5de9ad2fa77dad31e7c.tar.gz
bcm5719-llvm-2b11eb072992994d631ec5de9ad2fa77dad31e7c.zip
DSE: Poking holes into a SetVector is expensive, avoid it if possible.
llvm-svn: 163480
-rw-r--r--llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp b/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
index 25a1dd770af..1ff4329c846 100644
--- a/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
+++ b/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
@@ -775,15 +775,15 @@ bool DSE::handleEndBlock(BasicBlock &BB) {
LiveAllocas.push_back(*I);
}
- for (SmallVector<Value*, 8>::iterator I = LiveAllocas.begin(),
- E = LiveAllocas.end(); I != E; ++I)
- DeadStackObjects.remove(*I);
-
// If all of the allocas were clobbered by the call then we're not going
// to find anything else to process.
- if (DeadStackObjects.empty())
+ if (DeadStackObjects.size() == LiveAllocas.size())
break;
+ for (SmallVector<Value*, 8>::iterator I = LiveAllocas.begin(),
+ E = LiveAllocas.end(); I != E; ++I)
+ DeadStackObjects.remove(*I);
+
continue;
}
OpenPOWER on IntegriCloud