diff options
author | Chris Lattner <sabre@nondot.org> | 2010-08-29 05:12:21 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-08-29 05:12:21 +0000 |
commit | 63a75c13b110b89435ee5e30f1ce9ed57019ac5a (patch) | |
tree | 04bbf6f28060bb1b987eacdd300579d837b7dae0 | |
parent | 5033f64694cbb2bc8fcdebb43bc6ab40bcacda4d (diff) | |
download | external_llvm-63a75c13b110b89435ee5e30f1ce9ed57019ac5a.zip external_llvm-63a75c13b110b89435ee5e30f1ce9ed57019ac5a.tar.gz external_llvm-63a75c13b110b89435ee5e30f1ce9ed57019ac5a.tar.bz2 |
use getUniqueExitBlocks instead of a manual set.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112412 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Transforms/Scalar/LICM.cpp | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/lib/Transforms/Scalar/LICM.cpp b/lib/Transforms/Scalar/LICM.cpp index 639e958..a1868af 100644 --- a/lib/Transforms/Scalar/LICM.cpp +++ b/lib/Transforms/Scalar/LICM.cpp @@ -707,18 +707,10 @@ void LICM::PromoteValuesInLoop() { // 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; |