this works with backedges to the existing entry block alot better
authorAndrew Lenharth <andrewl@lenharth.org>
Thu, 10 Nov 2005 17:35:34 +0000 (17:35 +0000)
committerAndrew Lenharth <andrewl@lenharth.org>
Thu, 10 Nov 2005 17:35:34 +0000 (17:35 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24270 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/Reg2Mem.cpp

index be60b5a3588d6b75da1e6903f75b6dbfa90bf8d4..a43da7a60ac58e21dfca09043b67f868c517e37d 100644 (file)
@@ -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<Instruction*> worklist;