forked from OSchip/llvm-project
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
This commit is contained in:
parent
0bbf5418c6
commit
e5d7d9797b
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue