Simplify code

llvm-svn: 10371
This commit is contained in:
Chris Lattner 2003-12-10 16:58:24 +00:00
parent 7eff699231
commit d6d41b5e23

View File

@ -437,10 +437,8 @@ void LICM::sink(Instruction &I) {
BasicBlock *ExitBlock = ExitBlocks[i]; BasicBlock *ExitBlock = ExitBlocks[i];
if (isExitBlockDominatedByBlockInLoop(ExitBlock, InstOrigBB)) { 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 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... // Insert the code after the last PHI node...
BasicBlock::iterator InsertPt = ExitBlock->begin(); BasicBlock::iterator InsertPt = ExitBlock->begin();
while (isa<PHINode>(InsertPt)) ++InsertPt; 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 // Now that we have inserted the instruction, store it into the alloca
new StoreInst(New, AI, InsertPt); new StoreInst(New, AI, InsertPt);
// Remember we processed this block
InsertedBlocks.insert(SI, ExitBlock);
} }
} }
} }