diff options
author | Andrew Lenharth <andrewl@lenharth.org> | 2005-11-10 17:35:34 +0000 |
---|---|---|
committer | Andrew Lenharth <andrewl@lenharth.org> | 2005-11-10 17:35:34 +0000 |
commit | 99b8e26b84033b5932cfe2a1d1542ea33cb21a8a (patch) | |
tree | b53ee9126cadeb5cd16f326c08fa09b4cb4ce021 | |
parent | 7b441dc966804e363a76db00cb238af6d93d8409 (diff) | |
download | external_llvm-99b8e26b84033b5932cfe2a1d1542ea33cb21a8a.zip external_llvm-99b8e26b84033b5932cfe2a1d1542ea33cb21a8a.tar.gz external_llvm-99b8e26b84033b5932cfe2a1d1542ea33cb21a8a.tar.bz2 |
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
-rw-r--r-- | lib/Transforms/Scalar/Reg2Mem.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Transforms/Scalar/Reg2Mem.cpp b/lib/Transforms/Scalar/Reg2Mem.cpp index be60b5a..a43da7a 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<Instruction*> worklist; |