From: Chris Lattner Date: Fri, 13 Aug 2004 03:17:39 +0000 (+0000) Subject: When we code extract some stuff, leave the codeRepl block in the place where X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=337772832bb93ed98ee1e93c584ac3f82d9ea959;p=oota-llvm.git When we code extract some stuff, leave the codeRepl block in the place where 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 --- diff --git a/lib/Transforms/Utils/CodeExtractor.cpp b/lib/Transforms/Utils/CodeExtractor.cpp index b3de38a5db3..4521038dd66 100644 --- a/lib/Transforms/Utils/CodeExtractor.cpp +++ b/lib/Transforms/Utils/CodeExtractor.cpp @@ -622,7 +622,7 @@ ExtractCodeRegion(const std::vector &code) { 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.