search for: getmachinebasicblock

Displaying 16 results from an estimated 16 matches for "getmachinebasicblock".

2007 Aug 10
2
[LLVMdev] MBB Critical edges
...k; } // Scan the operands of this branch, replacing any // uses of dst with crit_mbb. for (unsigned i = 0, e = mii->getNumOperands(); i != e; ++i) { if (mii->getOperand(i).isMachineBasicBlock() && mii->getOperand(i).getMachineBasicBlock() == & dst) { found_branch = true; mii->getOperand(i).setMachineBasicBlock(crit_mbb); } } } Thanks a lot, Fernando
2010 Oct 15
2
[LLVMdev] how to get MachineBasicBlock of a BasicBlock
Hello, we can get BasicBlock from MachineBasicBlock through MachineBasicBlock::getBasicBlock() function, but how can I get MachineBasicBlock of a BasicBlock? Thank you!
2010 Oct 15
0
[LLVMdev] how to get MachineBasicBlock of a BasicBlock
I don't think you can. The BasicBlock is a member of MachineBasicBlock. It is not inherited, so it cannot be cast. The number of the MachineBasicBlock is not the same as any BasicBlock values. So MachineFunction::getMachineBasicBlock( BasicBlock::{get the number} ) cannot work. I do not see much in the basic block which can identify it. So you can search for it. typedef struct findBlock { BasicBlock * block; findBlock( BasicBlock * block ) : block(block) {} bool operator( MachineBasicBlock * mbb ) { return mbb->getBa...
2010 Oct 15
1
[LLVMdev] how to get MachineBasicBlock of a BasicBlock
...AM, Jeff Kunkel <jdkunk3 at gmail.com> wrote: > I don't think you can. > > The BasicBlock is a member of MachineBasicBlock. It is not inherited, > so it cannot be cast. The number of the MachineBasicBlock is not the > same as any BasicBlock values. So > MachineFunction::getMachineBasicBlock( BasicBlock::{get the number} ) > cannot work. I do not see much in the basic block which can identify > it. > > So you can search for it. > > typedef struct findBlock { > BasicBlock * block; > findBlock( BasicBlock * block ) : block(block) {} > bool operator( MachineB...
2007 Aug 17
0
[LLVMdev] MBB Critical edges
...// Scan the operands of this branch, replacing any > // uses of dst with crit_mbb. > for (unsigned i = 0, e = mii->getNumOperands(); i != e; ++i) { > if (mii->getOperand(i).isMachineBasicBlock() && > mii->getOperand(i).getMachineBasicBlock() == & dst) { > found_branch = true; > mii->getOperand(i).setMachineBasicBlock(crit_mbb); > } > } > } > > Thanks a lot, > > Fernando > _______________________________________________ > LLVM Developers ma...
2007 Aug 19
1
[LLVMdev] MBB Critical edges
...of this branch, replacing any uses of dst with // crit_mbb. for (unsigned i = 0, e = mii->getNumOperands(); i != e; ++i) { MachineOperand & mo = mii->getOperand(i); if (mo.isMachineBasicBlock() && mo.getMachineBasicBlock() == & dst) { found_branch = true; mo.setMachineBasicBlock(crit_mbb); } } } // Change jumps to go to the new basic block: if(isJumpTable) { mf.getJumpTableInfo()->ReplaceMBBInJumpTables(& dst, crit_mbb); }...
2008 Sep 30
2
[LLVMdev] Inserting MachineBasicBlock(s) before a MachineBasicBlock
I want to be able to do two things with LLVM (both just before code emission): 1. Insert a MachineBasicBlock just before a MachineBasicBlock. There is a function called AddPredecessor(). However, the comment says that it does not update the actual CFG. I want to redirect all CFG edges that are incoming to this MachineBasicBlock to the new one I create, and add just one outgoing edge (no branch)
2006 Apr 29
2
[LLVMdev] Register allocation in LLVM
...from Basic Blocks: MachineInstr *MPhi = MBB.remove(MBB.begin()); delete MPhi; - to create new instructions: BuildMI, http://llvm.org/docs/CodeGenerator.html - to discover the origin block of each operand in the phi function: MachineBasicBlock &opBlock = *MPhi->getOperand(i).getMachineBasicBlock(); Thank you in advance, Fernando
2006 Jul 09
2
[LLVMdev] Critical edges
...} // Scan the operands of this machine instruction, replacing any // use of dst with crit_mbb. for (unsigned i = 0, e = mii->getNumOperands(); i != e; ++i) { if (mii->getOperand(i).isMachineBasicBlock() && mii->getOperand(i).getMachineBasicBlock() == & dst) { mii->getOperand(i).setMachineBasicBlock(crit_mbb); } } } }
2007 Aug 17
2
[LLVMdev] MBB Critical edges
...he operands of this branch, replacing any >> // uses of dst with crit_mbb. >> for (unsigned i = 0, e = mii->getNumOperands(); i != e; ++i) { >> if (mii->getOperand(i).isMachineBasicBlock() && >> mii->getOperand(i).getMachineBasicBlock() == & dst) { >> found_branch = true; >> mii->getOperand(i).setMachineBasicBlock(crit_mbb); >> } >> } >> } >> >> Thanks a lot, >> >> Fernando >> _______________________________...
2006 May 01
0
[LLVMdev] Register allocation in LLVM
...*MPhi = MBB.remove(MBB.begin()); > delete MPhi; > > - to create new instructions: > BuildMI, http://llvm.org/docs/CodeGenerator.html > > - to discover the origin block of each operand in the phi function: > MachineBasicBlock &opBlock = > *MPhi->getOperand(i).getMachineBasicBlock(); Yup! -Chris -- http://nondot.org/sabre/ http://llvm.org/
2006 Jul 09
0
[LLVMdev] Critical edges
...Scan the operands of this machine instruction, replacing any > // use of dst with crit_mbb. > for (unsigned i = 0, e = mii->getNumOperands(); i != e; ++i) { > if (mii->getOperand(i).isMachineBasicBlock() && > mii->getOperand(i).getMachineBasicBlock() == & dst) { > mii->getOperand(i).setMachineBasicBlock(crit_mbb); > } > } > } > > } > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > h...
2007 Aug 18
0
[LLVMdev] MBB Critical edges
...lacing any >>> // uses of dst with crit_mbb. >>> for (unsigned i = 0, e = mii->getNumOperands(); i != e; + >>> +i) { >>> if (mii->getOperand(i).isMachineBasicBlock() && >>> mii->getOperand(i).getMachineBasicBlock() == & >>> dst) { >>> found_branch = true; >>> mii->getOperand(i).setMachineBasicBlock(crit_mbb); >>> } >>> } >>> } >>> >>> Thanks a lot, >>> >>&gt...
2006 Jul 05
0
[LLVMdev] Critical edges
> If you don't want critical edges in the machine code CFG, you're going to > have to write a machine code CFG critical edge splitting pass: LLVM > doesn't currently have one. > > -Chris Hey guys, I've coded a pass to break the critical edges of the machine control flow graph. The program works fine, but I am sure it is not the right way of implementing it.
2006 May 01
2
[LLVMdev] Register allocation in LLVM
...; >> delete MPhi; >> >> - to create new instructions: >> BuildMI, http://llvm.org/docs/CodeGenerator.html >> >> - to discover the origin block of each operand in the phi function: >> MachineBasicBlock &opBlock = >> *MPhi->getOperand(i).getMachineBasicBlock(); > > Yup! > > -Chris > > -- > http://nondot.org/sabre/ > http://llvm.org/ > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo...
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