the extracted code was, instead of putting it at the end of the function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15716
91177308-0d34-0410-b5e6-
96231b3b80d8
Function *oldFunction = header->getParent();
// This takes place of the original loop
- BasicBlock *codeReplacer = new BasicBlock("codeRepl", oldFunction);
+ BasicBlock *codeReplacer = new BasicBlock("codeRepl", oldFunction, header);
// The new function needs a root node because other nodes can branch to the
// head of the region, but the entry node of a function cannot have preds.