search for: callgraph

Displaying 20 results from an estimated 491 matches for "callgraph".

2002 Dec 06
3
[LLVMdev] Tarjan+function_ptrs == trouble ? (fwd)
Test Cases: (attached) Iteration code: (...) typedef TarjanSCC_iterator<CallGraph*> MyTarjan; CallGraph& callGraph = getAnalysis<CallGraph>(); MyTarjan iter = tarj_begin(&callGraph); MyTarjan end = tarj_end(&callGraph); while(iter!=end) iter++; (...) if you take the time to print out the function each non-looping node iter traverses, it never rea...
2011 Mar 30
1
[LLVMdev] Trouble traversing the CallGraph
I am finding some weird behavior in the CallGraph, and am not sure what am I doing wrong. When trying to traverse nodes in the CallGraph I get stuck in nodes representing external functions. Take the following code: ----- #include <stdio.h> int main() { printf( "Hello World!\n" ); } ----- If I try to traverse the CallGra...
2015 Jun 08
2
[LLVMdev] Use Callgraph
Hi All, I tried to use CallGraph in llvm by adding "AU.addRequired<CallGraph>();" in getAnalysisUsage function. But it reports an error: include/llvm/PassAnalysisSupport.h:56:39: error: ‘ID’ is not a member of ‘llvm::CallGraph’ return addRequiredID(PassClass::ID); How to use it correctly? Thanks, Haopen...
2012 Aug 17
3
[LLVMdev] Problem of use CallGraph
Hello, I want to traverse CallGraph code segment: virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired<CallGraph>(); } virtual bool runOnModule(Module &F) { CallGraph &g = getAnalysis<CallGraph>(); for ( CallGraph::iterator i = g.begin(); i != g.end(); i++) { e...
2002 Dec 06
1
[LLVMdev] Tarjan+function_ptrs == trouble ?
...this external node i think you are making reference to. Could this be the problem? Dave On Fri, 6 Dec 2002, Chris Lattner wrote: > > if you take the time to print out the function each non-looping node iter > > traverses, it never reaches main... > > Ok, first note that the CallGraph class does really stupid (but correct) > things for function pointers, so you're not going to see anything > remarkably nice here... Make sure to read the CallGraph.h comments to > understand exactly what is going on. > > Despite that, I can verify that the SCC iterator seems to...
2009 May 10
2
[LLVMdev] Get the call graph SCCs from a function pass
On 5/10/09, Török Edwin <edwintorok at gmail.com> wrote: > On 2009-05-10 20:11, Nick Johnson wrote: > > Hello, > > > > I'm writing a Function Pass. This function pass needs access to the > > CallGraph and CallGraph SCCs. Is there any way I can get CallGraph > > information without changing my pass to a CallGraphSCCPass ? > > > Does getAnalysis<CallGraph>() work? > AFAIK, it's not a pass. > But I'm not sure if using a FunctionPass to access Callgraph data is...
2012 Aug 17
0
[LLVMdev] Problem of use CallGraph
On Fri, Aug 17, 2012 at 4:23 PM, Jianfei Hu <hujianfei258 at gmail.com> wrote: > Hello, > I want to traverse CallGraph > > code segment: > > > virtual void getAnalysisUsage(AnalysisUsage &AU) const > { > AU.addRequired<CallGraph>(); > } > > virtual bool runOnModule(Module &F) >...
2018 May 07
2
Preservation of CallGraph (by BasicBlockPass, FunctionPass)
If I run: opt -globals-aa -die -inline -debug-pass=Details foo.ll -S then I will get this pass structure: Target Library Information Target Transform Information Target Pass Configuration Assumption Cache Tracker Profile summary info ModulePass Manager CallGraph Construction Globals Alias Analysis FunctionPass Manager BasicBlockPass Manager Dead Instruction Elimination Call Graph SCC Pass Manager Function Integration/Inlining FunctionPass Manager Module Verifier Print Module IR FPPassManager:: getAnalysis...
2008 Oct 08
2
[LLVMdev] Error while making new pass
Hi Devang, GlobalModRefPass is also a ModulePass and it uses CallGraph Analysis. So, I think it should not necessary to extend CallGraphSCCPass to use CallGraph information. Module Pass shoule be sufficient... --Kapil On 10/8/08, Devang Patel <dpatel at apple.com> wrote: > Hi Kapil, > > On Oct 8, 2008, at 10:19 AM, kapil anand wrote: > >> Hi...
2013 Jun 05
0
[LLVMdev] CallGraph, GraphTraits and DominatorTree
Hi there, I'm currently writing an analysis (for now) pass for LLVM that kind of need some information from the CallGraph of the program. This info would be extremely easy to get if I could build the DominatorTree information about the CallGraph. I even checked out and saw the declarations of GraphTraits templates for CallGraph and CallGraphNode, which might indicate that all algorithms that work with graphs in LLVM s...
2012 Oct 11
2
[LLVMdev] Function aliases in CallGraph
Hello, I have a simple program using aliases to functions, and it seems that the CallGraph doesn't follow these aliases. Here is the example: @alias = alias void ()* @realfunc define void @realfunc() { entry: ret void } define i32 @main() { entry: call void @alias() ret i32 0 } ******* Output of the CallGraph ******* Call graph node <<null function>><<0x...
2018 May 07
0
Preservation of CallGraph (by BasicBlockPass, FunctionPass)
...foo.ll -S > > > > then I will get this pass structure: > > > > Target Library Information > > Target Transform Information > > Target Pass Configuration > > Assumption Cache Tracker > > Profile summary info > > ModulePass Manager > > CallGraph Construction > > Globals Alias Analysis > > FunctionPass Manager > > BasicBlockPass Manager > > Dead Instruction Elimination > > Call Graph SCC Pass Manager > > Function Integration/Inlining > > FunctionPass Manager &gt...
2012 Nov 28
1
[LLVMdev] Inconsistent result with CallGraph
Hello: We are working with LLVM-3.1 and we have a problem.This is the code we have executed: virtual void getAnalysisUsage( llvm::AnalysisUsage & info ) const { info.addRequired<CallGraph>(); ... } ... virtual bool runOnModule( Module & M ) { ... CallGraph &CG = this->getAnalysis<CallGraph>(); CallGraphNode *cgn; unsigned nref; for(CallGraph::const_iterator I=CG.begin(),E=CG.end();I!=E;I++) { cgn=I->second; if((cgn)&&(cgn->ge...
2009 Feb 13
0
[LLVMdev] loop passes vs call graph
...bug 3367 first.) > > The reason the call graph isn't up to date is that -loop-unswitch has > changed a function and not updated the call graph. But that seems OK, > because -loop-unswitch's getAnalysisUsage() method doesn't claim to > preserve the call graph. given the callgraph F -> G, the pass manager currently does the following: run inliner on G, run loop passes on G, run inliner on F, run loop passes on F. Presumably what is happening is this: the loop passes change the functions that G calls (but don't update the callgraph). Now the inliner visits F and deci...
2015 Oct 09
2
Get instance of CallGraph of a module in the pass
Hello, I want an instance of CallGraph in my pass. By looking at -dot-callgraph source, I've tried something like this: CallGraphWrapperPass *CGWP = new CallGraphWrapperPass(); PM.add(CGWP); CallGraph *CG = &CGWP->getCallGraph(); PM.add(new MyPass(CG)); I get the following error: /home/riyad/installs/llvm-3.7.0/include/ll...
2009 May 10
2
[LLVMdev] Get the call graph SCCs from a function pass
Hello, I'm writing a Function Pass. This function pass needs access to the CallGraph and CallGraph SCCs. Is there any way I can get CallGraph information without changing my pass to a CallGraphSCCPass ? Thanks, -- Nick Johnson
2018 May 08
2
Preservation of CallGraph (by BasicBlockPass, FunctionPass)
...From: Sanjoy Das [mailto:sanjoy at playingwithpointers.com] > Sent: den 7 maj 2018 20:22 > To: Björn Pettersson A <bjorn.a.pettersson at ericsson.com>; Chandler > Carruth <chandlerc at google.com> > Cc: llvm-dev at lists.llvm.org > Subject: Re: [llvm-dev] Preservation of CallGraph (by BasicBlockPass, > FunctionPass) > > I'm not sure about the old pass manager, but I think the new pass > manager solves this issue. See > llvm::updateCGAndAnalysisManagerForFunctionPass where it updates the > call graph to be in sync with edges deleted by function passes....
2015 Feb 25
2
[LLVMdev] Walking thru CallGraph bottom up
Thanks John. I guess I will use a ModulePass, so when I am implementing the “runOnModule” function, do I have to loop through all the functions, for each functions all the BasicBlocks and for each BasicBlock all the instructions or given the Module I have to call the CallGraph directly? Is there an example out there? I can’t find anything. Thanks. Simone > On Feb 24, 2015, at 13:29, John Criswell <jtcriswel at gmail.com> wrote: > > On 2/24/15 2:27 PM, Simone Atzeni wrote: >> Hi all, >> >> I would like to create a Pass that given an IR...
2011 Mar 29
2
[LLVMdev] Anomaly with CallGraph construction
Hi all, I have been trying to build a loop nesting analysis which works interprocedurally. In order to find the functions called inside a given loop, I am traversing the Instructions into the BasicBlock's that conform a Loop, and applying the code that CallGraph construction uses: ------ extract from CallGraph.cpp : 144 // Look for calls by this function. for (Function::iterator BB = F->begin(), BBE = F->end(); BB != BBE; ++BB) for (BasicBlock::iterator II = BB->begin(), IE = BB->end(); II != IE; ++II) { CallSite CS(cast<Value>(II)...
2008 Oct 08
2
[LLVMdev] Error while making new pass
Hi all, I need a new kind of analysis on LLVM Module, so I made a new pass to do this. This new pass extends the ModulePass class and follows the conventions used in GlobalModRefPass, which is also a Module Pass.I need the CallGraph analysis for this pass, hence I have added (addRequired(CallGraph)) in getAnalysisUsage function of this new pass. I also added it to CallGraph Analysis group through "RegisterAnalysisGroup" This new pass is not part of any LLVM library and is not present in LLVM source tree . Rather it...