search for: succ_end

Displaying 20 results from an estimated 24 matches for "succ_end".

Did you mean: scc_end
2002 Nov 11
3
[LLVMdev] question about BasicBlock
Dear LLVM, Is there any simple way to decide whether there is a control path from one Basic Block to another Basic Block? thanks, Jerry
2002 Nov 11
1
[LLVMdev] question about BasicBlock
...attner wrote: > > > Is there any simple way to decide whether there is a control path from one > > Basic Block to another Basic Block? > > No efficient way, but you could do a depth first search... > > If you are looking for a DIRECT connection, try the > succ_begin()/succ_end() iterators (which loop over successors). > > -Chris > > -- > http://llvm.cs.uiuc.edu/ > http://www.nondot.org/~sabre/Projects/ > >
2015 Feb 24
2
[LLVMdev] Jump Theading/GVN bug - moving discussion to llvm-dev
...-cases of SSA def-use behavior does *not* need to be clever enough to deal with this example, since the verifier rejects this snippet (def of %m does not dominate its use). If all we care about are blocks that have to follow def-dominates-use in the intuitive sense then a super simple succ_begin()/succ_end() based DFS is sufficient. What I don't know is whether such a thing will be fast enough. In any case, I don't have enough experience with LLVM to have a strong / defensible opinion on this, and I'll defer to the decision taken by people who do. -- Sanjoy
2010 Apr 07
2
[LLVMdev] graph abstraction proposal
...es a reference to the data that is to look like a graph. e.g. struct BasicBlockGraph { Function& f; BasicBlockGraph(Function& f) : f(f) {} typedef BasicBlock NodeType; ... child_begin(NodeType* node) {return succ_begin(node);} child_begin(NodeType* node) {return succ_end(node);} ... }; An invese graph is just another implementation e.g. struct BasicBlockInverseGraph { ... child_begin(NodeType* node) {return pred_begin(node);} child_begin(NodeType* node) {return pred_end(node);} ... }; And finally, the goal of the whole stuff, the simplif...
2006 Jul 05
0
[LLVMdev] Critical edges
...k *> dst_blocks; // first, only find the critical edges: for(unsigned u = 0; u < mf.size(); u++) { MachineBasicBlock * mbb = mf.getBlockNumbered(u); for(MachineBasicBlock::succ_iterator succ = mbb->succ_begin(); succ != mbb->succ_end(); succ++) { MachineBasicBlock * mbb_succ = *succ; if(is_critical_edge(*mbb, *mbb_succ)) { src_blocks.push_back(mbb); dst_blocks.push_back(mbb_succ); } } } // second, break the critical edges: for(unsigned u =...
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
2009 Sep 06
0
[LLVMdev] How to differentiate between external and internal calls in llc?
...ether I exclude to many calls this way). But there appear to be CALL32r instructions that also call locations outside the program. Is there any way to determine the location of the call target more precisely? I tried for (MachineBasicBlock::succ_iterator SI = BB->succ_begin(), SE = BB->succ_end(); SI != SE; ++SI) { MachineBasicBlock *SBB = *SI; if (SBB->getParent()->getFunction()->isDeclaration()) skip = true; } but it seems not to do what I intended. -- View this message in context: http://www.nabble.com/How-to-differentiate-between-external-and-internal-calls-in-llc--tp2...
2010 Apr 08
0
[LLVMdev] graph abstraction proposal
...raph. > e.g. > struct BasicBlockGraph > { > Function& f; > > BasicBlockGraph(Function& f) : f(f) {} > > typedef BasicBlock NodeType; > > ... > child_begin(NodeType* node) {return succ_begin(node);} > child_begin(NodeType* node) {return succ_end(node);} > > ... > }; > > An invese graph is just another implementation > e.g. > struct BasicBlockInverseGraph > { > ... > > child_begin(NodeType* node) {return pred_begin(node);} > child_begin(NodeType* node) {return pred_end(node);} > > .....
2002 Nov 11
0
[LLVMdev] question about BasicBlock
> Is there any simple way to decide whether there is a control path from one > Basic Block to another Basic Block? No efficient way, but you could do a depth first search... If you are looking for a DIRECT connection, try the succ_begin()/succ_end() iterators (which loop over successors). -Chris -- http://llvm.cs.uiuc.edu/ http://www.nondot.org/~sabre/Projects/
2004 Aug 27
1
[LLVMdev] Help getting condition of branch instructions in pass
Hi, this is a bit of a newbie question: I am trying to discover, given a block with a conditional and its successors, which condition (T/F) each successor applies to. There's almost identical code in CFGPrinter.cpp, but where it gets called in GraphWriter.h, the child_iterator type is a pretty hairy thing, so I still don't quite understand how to get one from a BasicBlock in my own
2007 Aug 08
1
[LLVMdev] CFG leaf node
Hi, guys. Is there any easy way to know the leaf BB node in the CFG which is not terminated by such a 'br' instruction? E.g., for the following LLVM assembly: ----------------------------------------------------------- int %foo2(int %k) { entry: br label %bb bb: ; preds = %bb, %entry %indvar = phi uint [ 0, %entry ], [ %indvar.next, %bb ] ;
2010 Apr 09
0
[LLVMdev] graph abstraction proposal
.... > struct BasicBlockGraph > { > Function& f; > > BasicBlockGraph(Function& f) : f(f) {} > > typedef BasicBlock NodeType; > > ... > child_begin(NodeType* node) {return succ_begin(node);} > child_begin(NodeType* node) {return succ_end(node);} > > ... > }; > > An invese graph is just another implementation > e.g. > struct BasicBlockInverseGraph > { > ... > > child_begin(NodeType* node) {return pred_begin(node);} > child_begin(NodeType* node) {return pred_end(node);} > &gt...
2015 Aug 10
3
Possible bug in adjusting PHINode from removePredecessor?
Hi, Simple description of the problem below. I have code coming into pruneEH as follows fn a { entry: call fn b ... for_cond: %i = phi [1, entry] [%x, for_body] cmp $i with someval cond-br for_body or for_exit for_body: ... $x = $i + 1 branch for_cond for_exit ... } PruneEH determines that the call to fn-b won't return. The code is modified thus. fn a { entry: call fn b unreachable insn
2009 Jul 01
0
[LLVMdev] Profiling in LLVM Patch
...tSuccessors() - This gives an estimate of the number of successors of a > +// basic block. Returns 0, 1 or 2 depending on the block having no, one or more > +// than one successors respectively. > +static int countSuccessors(BasicBlock* BB) { > + succ_iterator SI = succ_begin(BB), SE = succ_end(BB); > + if ( SI != SE ) { // at least one successor > + ++SI; > + if ( SI == SE ) { // exactly on successor > + return 1; > + } else { // more than one successor > + return 2; > + } > + } else { > + return 0; > + } &g...
2015 Feb 24
3
[LLVMdev] Jump Theading/GVN bug - moving discussion to llvm-dev
> Handling unreachable code is annoying. I agree. However, its important to > characterize how annoying. Most code is not unreachable, and we're > (obviously) fine just bailing on such crazy code paths. So in practice the > common cost is keeping a local set to detect cycles in the graph where we > aren't expecting them. We are essentially always traversing a linked list
2018 May 24
0
LLVM Pass To Remove Dead Code In A Basic Block
> On 25 May 2018, at 01:46, Aaron via llvm-dev <llvm-dev at lists.llvm.org> wrote: > > Hi all, > > LLVM optimization pass gives an error "Terminator found in the middle of a basic block!" since basic block IR may have multiple "ret" instructions. It seems LLVM does not accept multiple return in a basic block by default. > Yes, if you’re inserting
2009 Jun 29
7
[LLVMdev] Profiling in LLVM Patch
Hi all, as proposed in http://lists.cs.uiuc.edu/pipermail/llvmdev/2009-February/020396.html I implemented the algorithm presented in [Ball94]. It only instruments the minimal number of edges necessary for edge profiling. The main changes introduced by this patch are: *) a interface compatible rewrite of ProfileInfo *) a cleanup of ProfileInfoLoader (some functionality in ProfileInfoLoader
2018 May 24
2
LLVM Pass To Remove Dead Code In A Basic Block
Hi all, LLVM optimization pass gives an error "Terminator found in the middle of a basic block!" since basic block IR may have multiple "ret" instructions. It seems LLVM does not accept multiple return in a basic block by default. Is there a specific optimization or pass that I can enable to remove unreachable codes in basic blocks? Best, Aaron -------------- next part
2018 May 24
2
LLVM Pass To Remove Dead Code In A Basic Block
...the successors of the 'this' block), and update any PHI nodes in // successors. If there were PHI nodes in the successors, then they need to // know that incoming branches will be from New, not from Old. // for (llvm::succ_iterator I = llvm::succ_begin(newBlock), E = llvm::succ_end(newBlock); I != E; ++I) { // Loop over any phi nodes in the basic block, updating the BB field of // incoming values... llvm::BasicBlock *Successor = *I; for (auto &PN : Successor->phis()) { int Idx = PN.getBasicBlockIndex(basicBlock);...
2007 Aug 19
1
[LLVMdev] MBB Critical edges
...; std::vector<MachineBasicBlock *> dst_blocks; for(unsigned u = 0; u < mf.size(); u++) { MachineBasicBlock * mbb = mf.getBlockNumbered(u); for(MachineBasicBlock::succ_iterator succ = mbb->succ_begin(); succ != mbb->succ_end(); succ++) { MachineBasicBlock * mbb_succ = *succ; // necessary and sufficient condition that characterizes a critical // edge: predecessor with many successors, successor with many // predecessors. if( (mbb->succ_size() > 1) &&a...