summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-12-10 16:57:24 +0000
committerChris Lattner <sabre@nondot.org>2003-12-10 16:57:24 +0000
commit48b4b852b4bb4f91a159ce146522adfe20456a3c (patch)
tree82cecbf9f0b06c915a85174cc26e0ff3db82feac
parentedda1af35a9c33da7713009bf024fda84d9e849e (diff)
downloadbcm5719-llvm-48b4b852b4bb4f91a159ce146522adfe20456a3c.tar.gz
bcm5719-llvm-48b4b852b4bb4f91a159ce146522adfe20456a3c.zip
Avoid performing two identical lookups when one will suffice
llvm-svn: 10370
-rw-r--r--llvm/lib/Transforms/Scalar/LICM.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Scalar/LICM.cpp b/llvm/lib/Transforms/Scalar/LICM.cpp
index 2293c17c001..cab43bd9fe1 100644
--- a/llvm/lib/Transforms/Scalar/LICM.cpp
+++ b/llvm/lib/Transforms/Scalar/LICM.cpp
@@ -603,9 +603,7 @@ void LICM::PromoteValuesInLoop() {
const std::vector<BasicBlock*> &ExitBlocks = CurLoop->getExitBlocks();
for (unsigned i = 0, e = ExitBlocks.size(); i != e; ++i)
- if (!ProcessedBlocks.count(ExitBlocks[i])) {
- ProcessedBlocks.insert(ExitBlocks[i]);
-
+ if (ProcessedBlocks.insert(ExitBlocks[i]).second) {
// Copy all of the allocas into their memory locations...
BasicBlock::iterator BI = ExitBlocks[i]->begin();
while (isa<PHINode>(*BI))
OpenPOWER on IntegriCloud