From 99b8e26b84033b5932cfe2a1d1542ea33cb21a8a Mon Sep 17 00:00:00 2001 From: Andrew Lenharth Date: Thu, 10 Nov 2005 17:35:34 +0000 Subject: [PATCH] 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 --- lib/Transforms/Scalar/Reg2Mem.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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; -- 2.34.1