Displaying 5 results from an estimated 5 matches for "mbb_it".
2006 Jul 05
0
[LLVMdev] Critical edges
...= src.getBasicBlock();
const BasicBlock * dst_bb = dst.getBasicBlock();
MachineBasicBlock * crit_mbb = new MachineBasicBlock(src_bb);
src.addSuccessor(crit_mbb);
crit_mbb->addSuccessor(& dst);
src.removeSuccessor(& dst);
ilist<MachineBasicBlock>::iterator mbb_it = mf.getLastBlock();
++mbb_it;
mf.getBasicBlockList().insert(mbb_it, crit_mbb);
}
2020 Mar 13
2
How to simply split MachineBasicBlock ?
...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 instruction)
BB --> BB1 , BB2
Then, I split BB, mi is the first instruction of BB2.
And the instruct...
2006 Jul 09
2
[LLVMdev] Critical edges
...* crit_mbb = new MachineBasicBlock(src_bb);
/// modify the llvm control flow graph
src.addSuccessor(crit_mbb);
crit_mbb->addSuccessor(& dst);
src.removeSuccessor(& dst);
/// insert the new block into the machine function.
ilist<MachineBasicBlock>::iterator mbb_it = mf.getLastBlock();
++mbb_it;
mf.getBasicBlockList().insert(mbb_it, crit_mbb);
/// insert a unconditional branch linking the new block to dst
const TargetMachine & tm = mf.getTarget();
const TargetInstrInfo * tii = tm.getInstrInfo();
tii->insertGoto(*crit_mbb, dst);...
2006 Jul 04
2
[LLVMdev] Critical edges
On Tue, 4 Jul 2006, Fernando Magno Quintao Pereira wrote:
> However, it does not remove all the critical edges. I am getting a very
> weird dataflow graph (even without the Break Critical edges pass). The
> dataflow generated by MachineFunction::dump() for the program below is
> given here:
> http://compilers.cs.ucla.edu/fernando/projects/soc/images/loop_no_crit2.pdf
...
> The
2006 Jul 09
0
[LLVMdev] Critical edges
...ck(src_bb);
>
> /// modify the llvm control flow graph
> src.addSuccessor(crit_mbb);
> crit_mbb->addSuccessor(& dst);
> src.removeSuccessor(& dst);
>
> /// insert the new block into the machine function.
> ilist<MachineBasicBlock>::iterator mbb_it = mf.getLastBlock();
> ++mbb_it;
> mf.getBasicBlockList().insert(mbb_it, crit_mbb);
>
> /// insert a unconditional branch linking the new block to dst
> const TargetMachine & tm = mf.getTarget();
> const TargetInstrInfo * tii = tm.getInstrInfo();
> tii->...