Insert cloned loop basic blocks before original loop header.

llvm-svn: 41713
This commit is contained in:
Devang Patel 2007-09-04 20:46:35 +00:00
parent e0cb6bb8da
commit f6ef552f3d
1 changed files with 3 additions and 1 deletions

View File

@ -145,7 +145,9 @@ Loop *llvm::CloneLoop(Loop *OrigL, LPPassManager *LPM, LoopInfo *LI,
BasicBlock *Latch = OrigL->getLoopLatch();
Function *F = Latch->getParent();
F->getBasicBlockList().insert(Latch, NewBlocks.begin(), NewBlocks.end());
F->getBasicBlockList().insert(OrigL->getHeader(),
NewBlocks.begin(), NewBlocks.end());
return NewParentLoop;
}