From: Andrew Lenharth Date: Thu, 10 Nov 2005 17:35:34 +0000 (+0000) Subject: this works with backedges to the existing entry block alot better X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=99b8e26b84033b5932cfe2a1d1542ea33cb21a8a;p=oota-llvm.git this works with backedges to the existing entry block alot better git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24270 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Scalar/Reg2Mem.cpp b/lib/Transforms/Scalar/Reg2Mem.cpp index be60b5a3588..a43da7a60ac 100644 --- a/lib/Transforms/Scalar/Reg2Mem.cpp +++ b/lib/Transforms/Scalar/Reg2Mem.cpp @@ -46,8 +46,9 @@ namespace { virtual bool runOnFunction(Function &F) { if (!F.isExternal()) { //give us a clean block - BasicBlock& bbhead = F.getEntryBlock(); - bbhead.splitBasicBlock(bbhead.begin()); + BasicBlock* bbold = &F.getEntryBlock(); + BasicBlock* bbnew = new BasicBlock("allocablock", &F, &F.getEntryBlock()); + new BranchInst(bbold, bbnew); //find the instructions std::list worklist;