diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2014-10-06 22:05:02 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2014-10-06 22:05:02 +0000 |
commit | e5d7d9797bd39d948eb88246ed99142667592f24 (patch) | |
tree | e5c8b600523072b6d5d9dc53dc4989e08dc9c7d9 /llvm/lib/Transforms/Utils/LoopUnroll.cpp | |
parent | 0bbf5418c6550a38822678ae103eb69c08d2344d (diff) | |
download | bcm5719-llvm-e5d7d9797bd39d948eb88246ed99142667592f24.tar.gz bcm5719-llvm-e5d7d9797bd39d948eb88246ed99142667592f24.zip |
LoopUnroll: Change code order of changes to new basic blocks
Add new basic blocks to `LoopInfo` earlier. No functionality change
intended (simplifies upcoming bugfix patch).
llvm-svn: 219150
Diffstat (limited to 'llvm/lib/Transforms/Utils/LoopUnroll.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/LoopUnroll.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Utils/LoopUnroll.cpp b/llvm/lib/Transforms/Utils/LoopUnroll.cpp index fd46a4b8e54..fbfebc3a8dc 100644 --- a/llvm/lib/Transforms/Utils/LoopUnroll.cpp +++ b/llvm/lib/Transforms/Utils/LoopUnroll.cpp @@ -308,6 +308,8 @@ bool llvm::UnrollLoop(Loop *L, unsigned Count, unsigned TripCount, BasicBlock *New = CloneBasicBlock(*BB, VMap, "." + Twine(It)); Header->getParent()->getBasicBlockList().push_back(New); + L->addBasicBlockToLoop(New, LI->getBase()); + if (*BB == Header) // Loop over all of the PHI nodes in the block, changing them to use // the incoming values from the previous block. @@ -327,8 +329,6 @@ bool llvm::UnrollLoop(Loop *L, unsigned Count, unsigned TripCount, VI != VE; ++VI) LastValueMap[VI->first] = VI->second; - L->addBasicBlockToLoop(New, LI->getBase()); - // Add phi entries for newly created values to all exit blocks. for (succ_iterator SI = succ_begin(*BB), SE = succ_end(*BB); SI != SE; ++SI) { |