From: Benjamin Kramer Date: Sun, 9 Sep 2012 16:44:05 +0000 (+0000) Subject: DSE: Poking holes into a SetVector is expensive, avoid it if possible. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=3be7584f40cc822252e613af0c42dcb17e6a5d05;p=oota-llvm.git DSE: Poking holes into a SetVector is expensive, avoid it if possible. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163480 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Scalar/DeadStoreElimination.cpp b/lib/Transforms/Scalar/DeadStoreElimination.cpp index 25a1dd770af..1ff4329c846 100644 --- a/lib/Transforms/Scalar/DeadStoreElimination.cpp +++ b/lib/Transforms/Scalar/DeadStoreElimination.cpp @@ -775,15 +775,15 @@ bool DSE::handleEndBlock(BasicBlock &BB) { LiveAllocas.push_back(*I); } - for (SmallVector::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::iterator I = LiveAllocas.begin(), + E = LiveAllocas.end(); I != E; ++I) + DeadStackObjects.remove(*I); + continue; }