search for: removesuccessor

Displaying 20 results from an estimated 20 matches for "removesuccessor".

2013 Apr 10
3
[LLVMdev] If Conversion and predicated returns
...e conditional returns? Alternatively, the diamond conversion routine contains this: // RemoveExtraEdges won't work if the block has an unanalyzable branch, // which can happen here if TailBB is unanalyzable and is merged, so // explicitly remove BBI1 and BBI2 as successors. BBI.BB->removeSuccessor(BBI1->BB); BBI.BB->removeSuccessor(BBI2->BB); RemoveExtraEdges(BBI); should something similar be added prior to the calls to RemoveExtraEdges in the simple and triangle conversion routines? Thanks in advance, Hal -- Hal Finkel Postdoctoral Appointee Leadership Computing Facility Ar...
2013 Apr 10
0
[LLVMdev] If Conversion and predicated returns
...rnatively, the diamond conversion routine contains this: > > // RemoveExtraEdges won't work if the block has an unanalyzable branch, > // which can happen here if TailBB is unanalyzable and is merged, so > // explicitly remove BBI1 and BBI2 as successors. > BBI.BB->removeSuccessor(BBI1->BB); > BBI.BB->removeSuccessor(BBI2->BB); > RemoveExtraEdges(BBI); > > should something similar be added prior to the calls to RemoveExtraEdges in the simple and triangle conversion routines? Both of these cases know what scenario they are dealing with (i.e. wheth...
2013 Jul 31
1
[LLVMdev] Problem to remove successors
Hi All, I need to remove successors from every basic block to insert new ones I tried this code, but it doesn't work void RemoveSuccessor(TerminatorInst *TI, unsigned SuccNum) { assert(SuccNum < TI->getNumSuccessors() && "Trying to remove a nonexistant successor!"); // If our old successor block contains any PHI nodes, remove the entry in the // PHI nodes that comes from this branch......
2008 Oct 14
3
[LLVMdev] CFG modifcations and code gen
...is not what the CFG is saying it should be done. The code I'm using to do this transformation, which takes 2 & 4 and places them after block 5 is: MachineBasicBlock* newExitPath = findLowestNumSuccBB(root); pHigh->addSuccessor(newExitPath); root->removeSuccessor(newExitPath); root->CorrectExtraCFGEdges(*root->succ_begin(), NULL, false); pHigh->CorrectExtraCFGEdges(*pHigh->succ_begin(), newExitPath, false); newExitPath->moveAfter(pHigh); root->getParent()->RenumberBlock...
2008 Oct 14
0
[LLVMdev] CFG modifcations and code gen
...saying it should be done. The code I’m using to > do this transformation, which takes 2 & 4 and places them after > block 5 is: > MachineBasicBlock* newExitPath = findLowestNumSuccBB(root); > pHigh->addSuccessor(newExitPath); > root->removeSuccessor(newExitPath); > root->CorrectExtraCFGEdges(*root->succ_begin(), > NULL, false); > pHigh->CorrectExtraCFGEdges(*pHigh->succ_begin(), > newExitPath, false); > newExitPath->moveAfter(pHigh); > root-&gt...
2010 May 01
1
[LLVMdev] How to change successor of a regular Basic block
Hi, I am working with regular dominator tree and not MachineDominatorTree. I wanted to modify the CFG structure and for that I need to change successor of a basic block. How can I do that? Or is there a way to cast a BasicBlock to MachineBasicBlock so that i can use functions addSucessor and removeSuccessor for the basic block. It will be great if someone can help. regards, Ambika
2006 Jul 05
0
[LLVMdev] Critical edges
...ock & dst, MachineFunction & mf) { const BasicBlock * src_bb = 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); }
2006 Jul 09
2
[LLVMdev] Critical edges
...hineBasicBlock & dst, MachineFunction & mf) { const BasicBlock * src_bb = src.getBasicBlock(); MachineBasicBlock * 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 TargetMachin...
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 Oct 03
0
[LLVMdev] Out of range address
On Tue, 3 Oct 2006, Fernando Magno Quintao Pereira wrote: > I am having some problems when compiling huge programs (like gcc). > I have a machine pass to destroy critical edges, and I have to add > new basic blocks, but sometimes the program is too big, and the new > basic block gets out of addressing range. What is the proper way to > address this problem? I am producing code
2006 Oct 03
2
[LLVMdev] Out of range address
Dear guys, I am having some problems when compiling huge programs (like gcc). I have a machine pass to destroy critical edges, and I have to add new basic blocks, but sometimes the program is too big, and the new basic block gets out of addressing range. What is the proper way to address this problem? I am producing code for the PowerPC, and I had to implement the insert go-to method. I am
2006 Jul 09
0
[LLVMdev] Critical edges
...tion & > mf) { > > const BasicBlock * src_bb = src.getBasicBlock(); > MachineBasicBlock * 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 t...
2010 Apr 14
3
[LLVMdev] indirect jumps
Hi, What kind of C/C++ high level code can generate a computed jump, such as: jmpq *%r14 or jmpq *(%r14,%rbx,8) ? I imagine that any calls (including virtual) would use something like 'call *%r14', and the above jumps are mostly from 'switch' statements. Is this correct? Anything else? Thank you, Dan
2010 Apr 15
1
[LLVMdev] Question About Cloning Machine Basic Block
...’ as well   If ‘I’ has 2 predecessors, then update the succ list of the second pred to point to ‘copy’ and insert ‘copy’ after the second pred (‘I’ physically resides after the first pred):   MachineFunction::iterator It = (predMBB+1); MF.insert(It,copy); predMBB->addSuccessor(copy); predMBB->removeSuccessor(I)   MF.RenumberBlocks();   Am I missing anything here?   Please note: I am doing this step as a pass just before the asm printer pass in the target machine layer after all the instructions has been generated, registers has been allocated.   Appreciate your help a lot,   Thanks, Hisham    ...
2008 Jan 27
0
[LLVMdev] BreakCriticalMachineEdge.h
Fernando, The code there should be more or less functional, though it's not currently used by anything. Eventually it should probably be moved to a method on MachineBasicBlock. The API breakage you're seeing is because some methods moved around. Feel free to fix it. :-) --Owen On Jan 26, 2008, at 6:31 PM, Fernando Magno Quintao Pereira wrote: > > Hi LLVMers, > >
2008 Jan 27
2
[LLVMdev] BreakCriticalMachineEdge.h
Hi LLVMers, what is the status of breaking critical edges in machine functions? I just compiled the top of the LLVM tree, and I found llvm/CodeGen/BreakCriticalMachineEdge.h. But this file seems not to be up-to-date with the other classes in the top of the tree. For instance, it calls isTerminatorInstr on llvm::TargetInstrInfo, but this method is no longer there. If I want to break
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)
2008 Oct 14
2
[LLVMdev] CFG modifcations and code gen
...not what the CFG is saying it should be done. The code I'm using to do this transformation, which takes 2 & 4 and places them after block 5 is: MachineBasicBlock* newExitPath = findLowestNumSuccBB(root); pHigh->addSuccessor(newExitPath); root->removeSuccessor(newExitPath); root->CorrectExtraCFGEdges(*root->succ_begin(), NULL, false); pHigh->CorrectExtraCFGEdges(*pHigh->succ_begin(), newExitPath, false); newExitPath->moveAfter(pHigh); root->getParent()->RenumberBlocks();...
2007 Aug 19
1
[LLVMdev] MBB Critical edges
...Block & src, MachineBasicBlock & dst, MachineFunction & mf) { const BasicBlock * src_bb = src.getBasicBlock(); const BasicBlock * dst_bb = dst.getBasicBlock(); MachineBasicBlock * crit_mbb = new MachineBasicBlock(src_bb); /// modify the llvm control flow graph src.removeSuccessor(& dst); src.addSuccessor(crit_mbb); crit_mbb->addSuccessor(& dst); /// insert the new block into the machine function. mf.getBasicBlockList().insert(mf.end(), crit_mbb); /// insert a unconditional branch linking the new block to dst const TargetMachine & tm...
2017 Nov 11
2
Update control flow graph when splitting a machine basic block?
Thank you for your reply! > Every MachineBasicBlock has a list of successors; you can access it with > the successors() accessor. That's what you should be using for any CFG > analysis. I am aware of these methods of class MachineBasicBlock, which allows one to access a MachineBasicBlock's successors and predecessors in the CFG. But the CFG itself may no longer be valid if a