search for: getreturnblock

Displaying 5 results from an estimated 5 matches for "getreturnblock".

2007 Mar 18
0
[LLVMdev] idf_iterator and MachineFunctions
...> Is there a recommended way to find the final block (the one with > successors={}) in a machine function? This isn't a property of the CFG in the general case. However, the UnifyFunctionExitNodes transformation/analysis provides it. From getAnalysis<UnifyFunctionExitNodes>().getReturnBlock(), you can visit the basic block predecessors recursively. — Gordon -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20070318/ec0bc472/attachment.html>
2007 Mar 18
4
[LLVMdev] idf_iterator and MachineFunctions
Hi, I need to do an inverse-depth-first iteration over the basic blocks in a machine function (i.e. starting from the last block and following predecessor edges) for a liveness analysis I'm writing. idf_iterator seems like it's almost the class I need, but it starts at the first block in the function at present, rather than the last one (because of the specialisiation of GraphTraits for
2010 Mar 31
2
[LLVMdev] CFG entry and exit blocks
...gereturn>) that > transform a function to have only 1 return instruction. That sounds like a good approach, except that this pass does not appear to produce a CFG with exactly one return block, but rather one or zero return blocks. The distinction is important because if the pass's getReturnBlock function returns null (see UnifyFunctionExitNodes.h), I'm back to square one of not having a single exit block. I'm wondering what would cause a CFG not to have a return block. The comments in UnifyFunctionExitNodes.cpp say: "If there are no return stmts in the Function, a nul...
2010 Mar 31
0
[LLVMdev] CFG entry and exit blocks
Dear Trevor, I'm too lazy to convert your .dot file into a graph file, but I'll make some comments anyway. :) First, LLVM does not guarantee that a function has a single exit block. Multiple basic blocks can have a return instruction as their terminator instruction. There is a pass (Unify Function Exit nodes i.e., -mergereturn <http://llvm.org/docs/Passes.html#mergereturn>)
2010 Mar 31
2
[LLVMdev] CFG entry and exit blocks
Hi, I'm confused about the entry and exit blocks of an LLVM CFG. I understand that every CFG has one and only one entry block, and this is confirmed by the existence of the getEntryBlock function in the Function class. But what about exit (a.k.a. return) blocks? At first I assumed that LLVM CFGs have one and only one exit block, too, but the following code is a counter-example: