search for: new_mbb

Displaying 2 results from an estimated 2 matches for "new_mbb".

2020 Mar 13
2
How to simply split MachineBasicBlock ?
...asicBlcok. (So, I stole the idea from ARM64BranchRelaxation::splitBlockBeforeInstr.) This is my code : // I would pass call instruction to this function void split_mbb(MachineInstr* mi){ MachineBasicBlock* mbb=mi->getParent(); MachineFunction* mf=mbb->getParent(); MachineBasicBlock* new_mbb=mf->CreateMachineBasicBlock(mbb->getBasicBlock()); MachineFunction::iterator mbb_it(mbb); mf->insert(mbb_it,new_mbb); new_mbb->splice(new_mbb->end(),mbb,mbb->begin(),mi); } Originally, mi is in BB. (mi would be a call instruction) (do not consider mi is a branch instructio...
2011 Nov 30
2
[LLVMdev] Problem using a label to a MachineBasicBlock
...s the following: (void)llvm::BlockAddress::get(const_cast<BasicBlock*>(MBB11->getBasicBlock())) In this way, BB1 will have its reference count incremented and the assertion will not trigger. So, after splitting the MachineBasicBlock and migrating the successors etc., I have to do: --- NEW_MBB->setHasAddressTaken(); (void)llvm::BlockAddress::get(const_cast<BasicBlock*>(NEW_MBB->getBasicBlock())) --- With this, my basic example works as expected. Now, I want to try this on a more complex example: --- typedef int callme_t(int a, int b); callme_t* c01; callme_t* c02; int foo...