similar to: [LLVMdev] How do I find all memory allocations in an llvm ir code file?

Displaying 20 results from an estimated 20000 matches similar to: "[LLVMdev] How do I find all memory allocations in an llvm ir code file?"

2010 Oct 15
0
[LLVMdev] How do I find all memory allocations in an llvm ir code file?
As others have mentioned, C++ mangles names (i.e., it changes the name of a symbol into a string that contains both the name, scope, and type of the variable or function), so if you know what the mangled name is of your allocator, you can recognize it. Additionally, I believe that functions with return values marked with the noalias attribute are, essentially, memory allocators because the
2012 Jan 26
0
[LLVMdev] [llvm-commits] [PATCH] BasicBlock Autovectorization Pass
On Thu, Jan 26, 2012 at 3:41 PM, Hal Finkel <hfinkel at anl.gov> wrote: > On Thu, 2012-01-26 at 15:36 -0600, Sebastian Pop wrote: >> arm-none-linux-gnueabi > > Indeed, adding -ccc-host-triple arm-none-linux-gnueabi I also get Minor remark: please use -target instead of -ccc-host-triple that is now deprecated. Thanks for looking at this testcase. Sebastian -- Qualcomm
2012 Jan 26
2
[LLVMdev] [llvm-commits] [PATCH] BasicBlock Autovectorization Pass
On Thu, 2012-01-26 at 15:36 -0600, Sebastian Pop wrote: > arm-none-linux-gnueabi Indeed, adding -ccc-host-triple arm-none-linux-gnueabi I also get vectorization (even though I don't get vectorization when targeting x86_64). I'll let you know what I find. -Hal -- Hal Finkel Postdoctoral Appointee Leadership Computing Facility Argonne National Laboratory
2011 Dec 09
0
[LLVMdev] Implementing devirtualization
On Thu, Dec 8, 2011 at 2:11 PM, Vitor Luis Menezes <vitor at utexas.edu> wrote: > We've got the following test case: > > > class A { > public: >   int x; >   A(int x) : x(x) {} >   int hoo() {return 4;} >   virtual int foo() {return x;} >   virtual int goo() {return foo()+10;} >   virtual int operator+(A &a) { >     return x + a.x; >   } > };
2013 Mar 11
2
[LLVMdev] How to detect all free() calls
Thanks. isFreeCall() works well but for %call2 = call i32 bitcast (i32 (...)* @free to i32 (i8*)*)(i8* %call1) nounwind, !dbg !16 So I tried to figure out when the above instruction occurred. When <stdlib.h> is included, free(buf2R1); turn into call void @free(i8* %call1) nounwind, !dbg !16 when I forget to include <stdlib.h>, free(buf2R1); turn into %call2 = call i32 bitcast (i32
2010 Oct 21
2
[LLVMdev] statically linked passes
Hi, I am trying to create a pass that should get statically linked into opt (since I'm on both mac and native win32 and win32 does not support LOADED_MODULEs, at least I get errors while trying to create one). So I have it working with CMake on windows but when I try to run the same code base on mac I get unresolved externals. Here is what I have done so far in the build system: Within
2011 Dec 08
2
[LLVMdev] Implementing devirtualization
We've got the following test case: class A { public: int x; A(int x) : x(x) {} int hoo() {return 4;} virtual int foo() {return x;} virtual int goo() {return foo()+10;} virtual int operator+(A &a) { return x + a.x; } }; class B : public A { public: B(int x) : A(x) {} int hoo() {return 2;} virtual int foo() {return A::foo()*2;} }; int main() { A* a = new A(1);
2016 Feb 09
2
Modified LLVM IR
Hi, I want to edit LLVM generated IR file, like as given below, Original LLVM IR file, @.str2 = private unnamed_addr constant [17 x i8] c"\0AI am in one_11\0A\00", align 1 ; Function Attrs: nounwind define i32 @one_1(i32 %ivar1, i32 %ivar2) #0 { entry: %ivar1.addr = alloca i32, align 4 %ivar2.addr = alloca i32, align 4 %isum = alloca i32, align 4 store i32 %ivar1, i32*
2013 Mar 11
0
[LLVMdev] How to detect all free() calls
if you don't include stdlib.h, where free() is declared, you'll simply get a default C function signature: int free(...); On Mon, Mar 11, 2013 at 1:56 AM, Jane <270611649 at qq.com> wrote: > Thanks. isFreeCall() works well but for > %call2 = call i32 bitcast (i32 (...)* @free to i32 (i8*)*)(i8* %call1) > nounwind, !dbg !16 > So I tried to figure out when the above
2016 Feb 10
2
Modified LLVM IR
Hi, I want to call/add some functions(that defined in another file) on top of some functions, and reflect the same changes in object file. No, I am not looking for contractor. Thanks, Deepika On Tue, Feb 9, 2016 at 7:04 PM, mats petersson <mats at planetcatfish.com> wrote: > What is the condition for adding this code? > > What have you tried so far? [Or are you looking for a
2016 Feb 10
2
Modified LLVM IR
Hi, Yes I am looking for IR pass that will do insert call of functions that defined in another file. Links/suggestions that guide me to start for adding IR pass will help me so much. Regards, Deepika On Wed, Feb 10, 2016 at 1:03 PM, mats petersson <mats at planetcatfish.com> wrote: > So how do you know what you want to modify (conceptually)? > > Have you got a IR pass that you
2016 Feb 10
2
Modified LLVM IR
Hi, My requirement is something like as given below, a.c => a.obj contains a1() and a2() function b.c => b.obj contains b1() and b2() function main.c => main.obj call to a1, a2, b1, b2 Now, I want to move a1(), a2() from a.obj to b2.obj and on top of function b1() When I call b1() from main, it should call first a1, a2 and then function definition of b1 Can you please give me some
2015 Jul 28
1
[LLVMdev] AliasSetTracker and UnknownInst's (callsites mostly) problem
Hi all, There is a problem about how AliasSetTracker merging AliasSet's when meet UnknownInst. When adding new pointer it looks for existing AliasSet's aliased with new pointer. And merging them together. It is ok for pointers: if %A mayalias %B and %B mayalias %C then %A mayalias %C. But the same logic when adding callsite is wrong ( findAliasSetForUnknownInst). Callsite may be known
2018 May 22
2
DSE: Remove useless stores between malloc & memset
You might want to look more carefully at how you're constructing the MemoryLocation.   The first argument is a pointer, and the second argument is the number of bytes pointed to by that pointer (or MemoryLocation::UnknownSize if the number of bytes accessed isn't known). More generally, copy-pasting code you don't understand isn't a good idea. -Eli On 5/22/2018 4:02 PM, Dávid
2020 May 26
3
Loop Unroll
Awesome, thanks! Now I have another question. I have a matrix multiplication code. This is my code: #include <stdio.h> #include <stdlib.h> #define n 4 int main(int argc, char *argv[]) { int i, j, k; int A[n][n], B[n][n], C[n][n]; for(i=0;i<n;i++){ for(j=0;j<n;j++){ A[i][j] = 1; B[i][j] = 2; C[i][j] = 0; } }
2018 May 22
0
DSE: Remove useless stores between malloc & memset
IR: define i32 @calloc_strlen_write_between() { %call = tail call noalias i8* @calloc(i32 10, i32 1) store i8 97, i8* %call, align 1 %call1 = tail call i32 @strlen(i8* %call) ret i32 %call1 } static bool eliminateStrlen(CallInst *CI, BasicBlock::iterator &BBI, AliasAnalysis *AA, MemoryDependenceResults *MD, const DataLayout &DL, const TargetLibraryInfo *TLI,
2013 Mar 11
2
[LLVMdev] How to detect all free() calls
Hi, I'm trying to write a pass to detect all free()/delete() call instructions in LLVM IR.The method is as follows. First I find Call Instructions: CallInst *CI=dyn_cast<CallInst>(&*i); then see if the Function name matches: name=CI->getCalledFunction()->getName(); if(name=="_ZdlPv"||name=="_ZdaPv"||name=="free")
2017 Nov 17
2
Ensuring that dead allocations from a custom allocator are killed by LLVM
Hello all, I have a custom allocator, and would like to teach LLVM about its semantics. In particular, I would like LLVM to kill allocations that are "dead", similar to dead new in C++. Consider this example: ; ModuleID = '<stdin>' source_filename = "Module" ; Function Attrs: inaccessiblememonly noinline norecurse nounwind declare i8* @alloc(i64)
2018 May 22
0
DSE: Remove useless stores between malloc & memset
Yeah, sorry for that. Better "It compiles ok (but maybe incorrect code)", not "It works" as I wrote. 2018-05-23 1:08 GMT+02:00 Friedman, Eli <efriedma at codeaurora.org>: > You might want to look more carefully at how you're constructing the > MemoryLocation. The first argument is a pointer, and the second argument > is the number of bytes pointed to by
2012 Apr 10
0
[LLVMdev] How to explain this weird phenomenon????????
Hi, my friends I finally insert the callInst into the hello.bc file.Then I compile the hello.bc to hello.o file and the check.c to check.o file. And I think by link those to .o file togetherI can get the executable ELF file(clang hello.o check.o -o finalfile). But when I link the two objective file, it said "hello.o: In function `main': hello.bc:(.text+0x69): undefined reference to