[llvm-commits] [llvm] r112412 - /llvm/trunk/lib/Transforms/Scalar/LICM.cpp
Chris Lattner
sabre at nondot.org
Sat Aug 28 22:12:21 PDT 2010
Author: lattner
Date: Sun Aug 29 00:12:21 2010
New Revision: 112412
URL: http://llvm.org/viewvc/llvm-project?rev=112412&view=rev
Log:
use getUniqueExitBlocks instead of a manual set.
Modified:
llvm/trunk/lib/Transforms/Scalar/LICM.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/LICM.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LICM.cpp?rev=112412&r1=112411&r2=112412&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LICM.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LICM.cpp Sun Aug 29 00:12:21 2010
@@ -707,18 +707,10 @@
// Now that the body of the loop uses the allocas instead of the original
// memory locations, insert code to copy the alloca value back into the
- // original memory location on all exits from the loop. Note that we only
- // want to insert one copy of the code in each exit block, though the loop may
- // exit to the same block more than once.
- //
- SmallPtrSet<BasicBlock*, 16> ProcessedBlocks;
-
+ // original memory location on all exits from the loop.
SmallVector<BasicBlock*, 8> ExitBlocks;
- CurLoop->getExitBlocks(ExitBlocks);
+ CurLoop->getUniqueExitBlocks(ExitBlocks);
for (unsigned i = 0, e = ExitBlocks.size(); i != e; ++i) {
- if (!ProcessedBlocks.insert(ExitBlocks[i]))
- continue;
-
// Copy all of the allocas into their memory locations.
BasicBlock::iterator BI = ExitBlocks[i]->getFirstNonPHI();
Instruction *InsertPos = BI;
More information about the llvm-commits
mailing list