search for: isrecursive

Displaying 11 results from an estimated 11 matches for "isrecursive".

2010 Nov 01
2
[LLVMdev] Identify recursion in a call graph
...rator.h, or declare your pass to be a > CallGraphSCCPass in which case it will work one strongly connected > component at a time. Converting my ModulePass to a CallGraphSCCPass doesn't seem feasible, so I'll use llvm::scc_iterator. Here's what I have so far: bool MyModulePass::isRecursive() { CallGraphNode* rootNode = getAnalysis<CallGraph>().getRoot(); for (scc_iterator<CallGraphNode*> SCCI = scc_begin(rootNode), E = scc_end(rootNode); SCCI != E; ++SCCI) { const std::vector<CallGraphNode*> &nextSCC = *SCCI; if (nextSCC.size() == 1 && SCCI.hasLo...
2010 Nov 02
2
[LLVMdev] Identify recursion in a call graph
...Nov 2, 2010 at 4:27 AM, Duncan Sands <baldrick at free.fr> wrote: > Hi Trevor, > > > Converting my ModulePass to a CallGraphSCCPass doesn't seem feasible, so > I'll > > use llvm::scc_iterator. Here's what I have so far: > > > > bool MyModulePass::isRecursive() { > > CallGraphNode* rootNode = getAnalysis<CallGraph>().getRoot(); > > for (scc_iterator<CallGraphNode*> SCCI = scc_begin(rootNode), E = > > scc_end(rootNode); SCCI != E; ++SCCI) { > > const std::vector<CallGraphNode*> &nextSCC = *SCCI; > > if...
2010 Nov 03
2
[LLVMdev] Identify recursion in a call graph
...it up as a patch for the LLVM trunk so that others can use it. Your suggestion to create a new pass for the code is interesting, but I'm not sure that this feature warrants an entirely new pass. Maybe it's more appropriate to integrate with the existing CallGraph pass by adding an isRecursive method to CallGraphNode. For example: AU.addRequired<CallGraph>(); ... CallGraphNode* rootNode = getAnalysis<CallGraph>().getRoot(); if (rootNode->isRecursive()) { ... } But I have no idea how to write a test case for this. It appears that LLVM is not set up for unit...
2010 Nov 05
3
[LLVMdev] Identify recursion in a call graph
On Nov 2, 2010, at 11:08 PM, Nick Lewycky wrote: > The unittests/ directory contains C++ unit tests for arbitrary C++ > APIs > that don't fit the dejagnu model of running opt or llc over .ll files. Thanks for the tip. Attached is a patch+testcase that adds CallGraphNode::isRecursive to LLVM. Could someone with commit access please review and apply? Thanks, Trevor -------------- next part -------------- A non-text attachment was scrubbed... Name: isRecursive_LLVM-2.8.patch Type: application/octet-stream Size: 1726 bytes Desc: not available URL: <http://lists.llvm.org/pip...
2010 Nov 02
0
[LLVMdev] Identify recursion in a call graph
Hi Trevor, > Converting my ModulePass to a CallGraphSCCPass doesn't seem feasible, so I'll > use llvm::scc_iterator. Here's what I have so far: > > bool MyModulePass::isRecursive() { > CallGraphNode* rootNode = getAnalysis<CallGraph>().getRoot(); > for (scc_iterator<CallGraphNode*> SCCI = scc_begin(rootNode), E = > scc_end(rootNode); SCCI != E; ++SCCI) { > const std::vector<CallGraphNode*> &nextSCC = *SCCI; > if (nextSCC.size() == 1 &amp...
2010 Nov 02
0
[LLVMdev] Identify recursion in a call graph
...Sands <baldrick at free.fr> wrote: > >> Hi Trevor, >> >> > Converting my ModulePass to a CallGraphSCCPass doesn't seem feasible, so >> I'll >> > use llvm::scc_iterator. Here's what I have so far: >> > >> > bool MyModulePass::isRecursive() { >> > CallGraphNode* rootNode = getAnalysis<CallGraph>().getRoot(); >> > for (scc_iterator<CallGraphNode*> SCCI = scc_begin(rootNode), E = >> > scc_end(rootNode); SCCI != E; ++SCCI) { >> > const std::vector<CallGraphNode*> &nextSCC = *SCC...
2010 Nov 06
0
[LLVMdev] Identify recursion in a call graph
...v 2, 2010, at 11:08 PM, Nick Lewycky wrote: > >> The unittests/ directory contains C++ unit tests for arbitrary C++ APIs >> that don't fit the dejagnu model of running opt or llc over .ll files. > > Thanks for the tip. Attached is a patch+testcase that adds CallGraphNode::isRecursive to LLVM. Could someone with commit access please review and apply? Thanks, Hi Trevor, What is the desired behavior for code like this? extern void bar(); void foo() { ... bar(); ... } In this situation, the call graph will report that foo is not recursive. However, it *is* possible that...
2010 Nov 03
0
[LLVMdev] Identify recursion in a call graph
...the > LLVM trunk so that others can use it. > > Your suggestion to create a new pass for the code is interesting, but > I'm not sure that this feature warrants an entirely new pass. Maybe > it's more appropriate to integrate with the existing CallGraph pass by > adding an isRecursive method to CallGraphNode. For example: > > AU.addRequired<CallGraph>(); > ... > CallGraphNode* rootNode = getAnalysis<CallGraph>().getRoot(); > if (rootNode->isRecursive()) { ... } > > But I have no idea how to write a test case for this. It appear...
2010 Oct 29
2
[LLVMdev] Identify recursion in a call graph
Hi, Is there any facility in LLVM to identify recursion in a call graph? I realize this is undecidable in the general case due to function pointers, but at least the static cases could be identified. I don't even care about whole-program recursion, just looking at a single module would suffice. But I don't see anything like this already in LLVM, so do I simply write some code to
2010 Oct 30
0
[LLVMdev] Identify recursion in a call graph
Hi Trevor, > Is there any facility in LLVM to identify recursion in a call graph? I > realize this is undecidable in the general case due to function > pointers, but at least the static cases could be identified. I don't > even care about whole-program recursion, just looking at a single > module would suffice. But I don't see anything like this already in > LLVM, so do
2010 Jun 08
1
[LLVMdev] the PartialSpecialization pass (was Re: Is there a "callback optimization"?)
Good evening, Kenneth. Thank you to apply (and rewrite my naive code better) and to file the issue to http://llvm.org/bugs/show_bug.cgi?id=7304 I have checked r105528 at this morning. I think the pass must be still cleaned up and rewritten. There are my two proposals for enhancement. 1) To separate Specialization(and rewriting callsites) to other module. It would be better if new module were