Displaying 7 results from an estimated 7 matches for "nextscc".
Did you mean:
nextscb
2010 Nov 01
2
[LLVMdev] Identify recursion in a call graph
.... 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.hasLoop()) {
return true;
}
}
return false;
}
This correctly identifies direct (self) recursion but fails to
identify indirect recursion, such as:
void foo() { bar(); }
void bar() { foo(); }
Any suggestions on how to identify both types...
2010 Nov 02
0
[LLVMdev] Identify recursion in a call graph
...e 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.hasLoop()) {
> return true;
> }
> }
> return false;
> }
>
> This correctly identifies direct (self) recursion but fails to identify indirect
> recursion, such as:
>
> void foo() { bar(); }
> void bar() { foo(); }...
2010 Nov 02
2
[LLVMdev] Identify recursion in a call graph
...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.hasLoop()) {
> > return true;
> > }
> > }
> > return false;
> > }
> >
> > This correctly identifies direct (self) recursion but fails to identify
> indirect
> > recursion, such as:
> >...
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
2010 Nov 02
0
[LLVMdev] Identify recursion in a call graph
...s::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.hasLoop()) {
>> > return true;
>> > }
>> > }
>> > return false;
>> > }
>> >
>> > This correctly identifies direct (self) recursion but fails to identify
>> indirect
&g...
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