Skip to content
This repository was archived by the owner on Apr 23, 2020. It is now read-only.

Commit 9aba189

Browse files
committed
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). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219150 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 703bd8d commit 9aba189

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/Transforms/Utils/LoopUnroll.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,8 @@ bool llvm::UnrollLoop(Loop *L, unsigned Count, unsigned TripCount,
308308
BasicBlock *New = CloneBasicBlock(*BB, VMap, "." + Twine(It));
309309
Header->getParent()->getBasicBlockList().push_back(New);
310310

311+
L->addBasicBlockToLoop(New, LI->getBase());
312+
311313
if (*BB == Header)
312314
// Loop over all of the PHI nodes in the block, changing them to use
313315
// the incoming values from the previous block.
@@ -327,8 +329,6 @@ bool llvm::UnrollLoop(Loop *L, unsigned Count, unsigned TripCount,
327329
VI != VE; ++VI)
328330
LastValueMap[VI->first] = VI->second;
329331

330-
L->addBasicBlockToLoop(New, LI->getBase());
331-
332332
// Add phi entries for newly created values to all exit blocks.
333333
for (succ_iterator SI = succ_begin(*BB), SE = succ_end(*BB);
334334
SI != SE; ++SI) {

0 commit comments

Comments
 (0)