aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms/Scalar
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
commitf594a03197ddd6437ca5eb3c2c61d339528e0da4 (patch)
treedd340dea6ea140af895b87b0fbf54a7247c38d20 /lib/Transforms/Scalar
parent0ed2da9ac733c51ba004c067d3b552c1fa54613d (diff)
downloadexternal_llvm-f594a03197ddd6437ca5eb3c2c61d339528e0da4.zip
external_llvm-f594a03197ddd6437ca5eb3c2c61d339528e0da4.tar.gz
external_llvm-f594a03197ddd6437ca5eb3c2c61d339528e0da4.tar.bz2
Avoid performing two identical lookups when one will suffice
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10370 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar')
-rw-r--r--lib/Transforms/Scalar/LICM.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/Transforms/Scalar/LICM.cpp b/lib/Transforms/Scalar/LICM.cpp
index 2293c17..cab43bd 100644
--- a/lib/Transforms/Scalar/LICM.cpp
+++ b/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))