similar to: How to count instructions in a function?

Displaying 20 results from an estimated 3000 matches similar to: "How to count instructions in a function?"

2017 Nov 30
1
How to count instructions in a function?
Thanks so much John! That works :) Previously I wrote a pass that inherited from CallGraphWrapperPass and used its getCallGraph() function within runOnModule() which resulted in segmentation faults for me. Not sure why that happened, perhaps callgraph wasn't setup by the time runOnModule() was called internally. If you know why, kindly enlighten me and perhaps document the behavior for the
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/llvm/PassSupport.h:95:38: error: no matching constructor for
2015 May 20
3
[LLVMdev] Processing functions in call graph SCC "order" with function-level analyses
So I got very mixed results. With the CallGraphSCCPass, both `addRequired<DominatorTreeWrapperPass>` and `addRequired<MemoryDependenceAnalysis>` fail at runtime. The LLVM core has just two CallGraphSCCPasses and neither uses neither analyses, so it's hard to find a valid example. I transformed the pass into a ModulePass, using scc_iterator as shown in CGPassManager to process
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, Haopeng
2015 Jun 17
2
[LLVMdev] metadata in callgraph
Hi All, It seems that functions in callgraph remove all metadata info, such as dbg. Can I keep metadata in callgraph? Best, Haopeng
2015 May 19
3
[LLVMdev] Processing functions in call graph SCC "order" with function-level analyses
Thanks John. Does this solve the problem of analysis availability though? If I still have to run the function analyses manually, I might as well keep rolling with the CallGraphSCCPass. (I probably should have mentioned that this is what I’m using right now.) Félix > Le 2015-05-19 à 10:12:32, John Criswell <jtcriswel at gmail.com> a écrit : > > On 5/18/15 10:45 PM, Félix Cloutier
2015 Feb 27
2
[LLVMdev] Walking thru CallGraph bottom up
Hi Simon, > From: Simone Atzeni <simone.at at gmail.com> > To: John Criswell <jtcriswel at gmail.com> > Cc: llvmdev at cs.uiuc.edu > Subject: Re: [LLVMdev] Walking thru CallGraph bottom up > Message-ID: <318EBA41-2040-4EFE-B330-5813C817C2A2 at gmail.com> > Content-Type: text/plain; charset="windows-1252" > > I think I got it and the example is
2015 Dec 03
3
Function attributes for LibFunc and its impact on GlobalsAA
----- Original Message ----- > From: "James Molloy via llvm-dev" <llvm-dev at lists.llvm.org> > To: "Vaivaswatha Nagaraj" <vn at compilertree.com> > Cc: "LLVM Dev" <llvm-dev at lists.llvm.org> > Sent: Thursday, December 3, 2015 4:41:46 AM > Subject: Re: [llvm-dev] Function attributes for LibFunc and its impact on GlobalsAA > >
2015 Feb 27
0
[LLVMdev] Walking thru CallGraph bottom up
Dear Simon, Kevin is correct; as far as I can tell, there is no method of getting the functions calling a given function. Instead, you have to start at the main() function and search for the function using a depth-first or breadth-first search. What may make sense is to build a new data structure that has nodes that point from callees to callers once and then use that for your queries.
2004 Jun 22
3
Regression Modeling query
Hi All I received a raw data set with one record per tennis player (both male and female) and then i cured it by aggregation i.e by 4 age groups, 2 gender levels and 6 income levels. Gender and Income are categorical variables. Please advise me how to use 'R' to model this data set (Actually, i want to know the right regression technique and steps to do that, including removing
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++) { errs()<<"-----------------\n";
2010 Nov 30
3
[LLVMdev] LLVM Inliner
On Nov 29, 2010, at 1:17 AM, Duncan Sands wrote: > Hi David, > >> Interesting -- LLVM does perform on the fly cleanups during inlining >> transformation -- this will make summary update precise. One thing I notice from >> the debug pass dump is that the 'deduce function attribute' pass happens before >> the clean up -- Is it intended? > > you are
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
2009 May 11
2
[LLVMdev] Pass Manager hangs with CallGraph and LoopSimplify
Hello, I have discovered a situation in which the pass manager will infinite loop. The minimal test case is below this message. The required structure of these passes is; Before requires CallGraph After requires LoopSimplify and Before I can observe this through opt: opt -load ./libBug.so -after input.bc -o output.bc I built my copy of llvm from svn revision 68820 using gcc 4.1.2 Any
2006 Dec 04
2
[LLVMdev] problem using scc_iterator on CallGraph
I am working on a transform that uses an scc_iterator on a program's CallGraph. However, I am running into a problem in which not all callees are being processed before callers, leading me to believe there might be a bug. In particular, this is happening in a case where a callee is a function pointer. I ran bugpoint and have included the bugpoint-reduced-simplified.ll below. If
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
2015 May 15
2
[LLVMdev] DSA / poolalloc: incorrect callgraph for indirect call
Hello, I am trying to apply DSA (from the poolalloc project - I'm on LLVM 3.2) on the following C program and found that the generated callgraph over-approximates the callees for the simple indirect call. #include <stdio.h> __attribute__((noinline)) static int f1(int arg1, int arg2) { return arg1 + arg2; } __attribute__((noinline)) static int run_func(int (*fptr)(int, int), int
2015 May 24
2
[LLVMdev] Callgraph inaccuracy
Hello, I am trying to extract a callgraph using DSA, but the analysis looks quite pessimistic. I use TDD analysis and here is my test code: #include <stdlib.h> typedef void (*tX)(int a, int b); typedef void (*tY)(int a); typedef struct { tX p ; int n; } msg; static void A1(int a) { } static void B2(int a, int b) { } static void C2(int a, int b) { } tY q; static void decode(tX
2010 Jun 09
1
[LLVMdev] Segmentation fault 'cause of accessing function arguments
Hi all, I am experimenting to run a pass inherited from CallGraphSCCPass. In the pass, I iterate all functions in a SCC. In each iteration, I access all arguments of a function in the following way: Function::arg_iterator PI = fun->arg_begin(), PE = fun->arg_end(); ... I have no trouble with building. However, I am troubled with "segmentation fault" when I run the pass
2006 Dec 04
1
[LLVMdev] problem using scc_iterator on CallGraph
I printed the call graph as you suggested. The bugpoint bytecode that I sent below prints the following call graph: Indirect call node / | | \ / | | \ V | V V execute | prog_char clear_func | | V V push_constant | V Node0x8d7b370 i.e., Indirect call node -> execute