similar to: [LLVMdev] metadata in callgraph

Displaying 20 results from an estimated 2000 matches similar to: "[LLVMdev] metadata in callgraph"

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 02
2
[LLVMdev] struct type parament
I tried to compare two types. Because of renaming, the comparison result is not as expected. How to deal with renaming while comparing types? Best, Haopeng On 6/2/15 4:09 PM, Mehdi Amini wrote: > Hi Haopeng, > > One more element, I just noticed you are using LTO, I am not sure how it is implemented but my guess is that there is a shared LLVMContext. If multiple files include this
2015 Jun 02
2
[LLVMdev] struct type parament
Hi Mehdi, Thanks for your reply. It seems caused by random rename because I saw %struct.StructTyName.692.475*, which might be twice renaming. Does this collision occur because this type is declared more than once? I encountered this problem when used clang to compile transmission 1.42 (http://download.transmissionbt.com/files/) with configuration: "./configure --disable-gtk". Then
2015 Feb 16
2
[LLVMdev] alias result
Oh, got it. Thanks for your explain. I misunderstand what getLocation does. If I would like to get the result of alias analysis referring to the stored value, what should I do in llvm? On 2/16/15 1:42 PM, Hal Finkel wrote: > ----- Original Message ----- >> From: "Haopeng Liu" <hyliuhp at gmail.com> >> To: "Hal Finkel" <hfinkel at anl.gov> >>
2015 Feb 16
2
[LLVMdev] alias result
Yes, in my example, %1 and %2 point to t. %3 points to t2. But t and t2 point to the same var, is it? That's where I'm confused. On 2/16/15 12:37 PM, Hal Finkel wrote: > ----- Original Message ----- >> From: "Haopeng Liu" <hyliuhp at gmail.com> >> To: "Hal Finkel" <hfinkel at anl.gov> >> Cc: llvmdev at cs.uiuc.edu >> Sent:
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 Feb 20
3
[LLVMdev] basicaa result
Hi, I'm trying to explore basicaa alias analysis. test.c: int main() { int a; int *p, *q; p = &a; q = p; ... } Commands: clang -emit-llvm -c -g -O0 test.c -o test.bc opt -basicaa -print-must-aliases test.bc However, the result shows that p and q are no alias. Could anyone explain it? Your help is much appreciated! -Haopeng
2015 Jun 02
2
[LLVMdev] struct type parament
Hi All, I generated the following code with "clang -flto" command. void test(struct StruTyName *a) { ... } Then the type of test function is "void (%struct.StruTyName.100*)" by calling function::getFunctionType API. What's the meaning of number 100? Best, Haopeng
2015 Feb 16
2
[LLVMdev] alias result
t and t2 are two pointers defined in .c file. The definitions in .bc are: %thd = alloc i64, align 8 %t = alloca i64*, align 8 %t2 = alloca i64*, align 8 .c file likes this: int thd; int *t = &thd; int *t2 = t; On 2/16/15 12:28 PM, Hal Finkel wrote: > ----- Original Message ----- >> From: "Haopeng Liu" <hyliuhp at gmail.com> >> To: llvmdev at cs.uiuc.edu
2017 Nov 29
2
How to count instructions in a function?
Hello, I am trying to count IR instructions in a function for static analysis using llvm pass. In contrast with existing examples, I am trying to include instruction counts of all the callees of the function. Counting the instructions of a function is easy using passes, but iterating through the module's CallGraph is proving to be confusing. I believe I have to use CallGraphWrapperPass to
2015 Feb 16
2
[LLVMdev] alias result
Hi all, I am implementing a pass which needs aliasanalysis in llvm. My pass firstly records all store or load instructions as follows: loc[cnt++] = AA.getLocation(si/li); Then, get each pairwise alias result. AliasAnalysis::AliasResult ar = AA.alias(loc[i], loc[j]); switch(ar){ case 0,1,2,3;} And the command is: opt -load mypass.so -mypass -basicaa test.bc The store/load in test.bc: (1):
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 Mar 02
2
[LLVMdev] clang change function name
Got it, thanks. But in my pass, I use function name to locate. Can I disable mangling in clang? Best, Haopeng On 3/1/15 10:44 PM, John Criswell wrote: > On 3/1/15 11:38 PM, Haopeng Liu wrote: >> Hi, >> >> I compile a .cpp with cmd: >> clang++ -emit-llvm -c -g -O0 -w pbzip2.cpp -o pbzip2.bc -lbz2 >> llvm-dis pbzip2.bc >> >> One function in .cpp is
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 Mar 02
2
[LLVMdev] clang change function name
On Mon, Mar 02, 2015 at 12:12:34AM -0500, John Criswell wrote: > On 3/2/15 12:07 AM, Haopeng Liu wrote: > >Got it, thanks. But in my pass, I use function name to locate. Can I > >disable mangling in clang? > > No, but you can probably fine a library that can either mangle the original > name or demangle the name you're seeing in the LLVM bitcode. > > As an FYI,
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 CallGraph using the following code: ----- CallGraph CG
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
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";
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
2015 Dec 08
3
Get root node of CallGraph
Hi, There is a "Root" private member in CallGraph <http://llvm.org/docs/doxygen/html/CallGraph_8h_source.html#l00192> class. But there is no way to get access to that member. How can I do that? I can get CallGraphNode of "main" method. But I am curious is there more cleaner way. Thanks, Riyad -------------- next part -------------- An HTML attachment was scrubbed...