aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms/Scalar
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-12-10 16:58:24 +0000
committerChris Lattner <sabre@nondot.org>2003-12-10 16:58:24 +0000
commite3cfe8d563fa06b274587aa38b1359ff707f33de (patch)
treee396b73129d5615c71017bd590ca57c5693cc7f2 /lib/Transforms/Scalar
parentf594a03197ddd6437ca5eb3c2c61d339528e0da4 (diff)
downloadexternal_llvm-e3cfe8d563fa06b274587aa38b1359ff707f33de.zip
external_llvm-e3cfe8d563fa06b274587aa38b1359ff707f33de.tar.gz
external_llvm-e3cfe8d563fa06b274587aa38b1359ff707f33de.tar.bz2
Simplify code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10371 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar')
-rw-r--r--lib/Transforms/Scalar/LICM.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/lib/Transforms/Scalar/LICM.cpp b/lib/Transforms/Scalar/LICM.cpp
index cab43bd..ab64ece 100644
--- a/lib/Transforms/Scalar/LICM.cpp
+++ b/lib/Transforms/Scalar/LICM.cpp
@@ -437,10 +437,8 @@ void LICM::sink(Instruction &I) {
BasicBlock *ExitBlock = ExitBlocks[i];
if (isExitBlockDominatedByBlockInLoop(ExitBlock, InstOrigBB)) {
- std::set<BasicBlock*>::iterator SI =
- InsertedBlocks.lower_bound(ExitBlock);
// If we haven't already processed this exit block, do so now.
- if (SI == InsertedBlocks.end() || *SI != ExitBlock) {
+ if (InsertedBlocks.insert(ExitBlock).second) {
// Insert the code after the last PHI node...
BasicBlock::iterator InsertPt = ExitBlock->begin();
while (isa<PHINode>(InsertPt)) ++InsertPt;
@@ -461,9 +459,6 @@ void LICM::sink(Instruction &I) {
// Now that we have inserted the instruction, store it into the alloca
new StoreInst(New, AI, InsertPt);
-
- // Remember we processed this block
- InsertedBlocks.insert(SI, ExitBlock);
}
}
}