search for: memorybuiltins

Displaying 20 results from an estimated 34 matches for "memorybuiltins".

2016 Jan 04
3
Optimizing memory allocation for custom allocators and non C code
...to waste effort in duplicated work and/or end up with suboptimal solutions. I collected 2 use cases for inaccessiblememonly : - Allocation like functions. - Runtime functions for managed languages, that touch state that the program itself can never touch directly. My initial reflection was that MemoryBuiltins use a set of hardcoded functions to do its magic. Doing so, it support the C API fairly well, some variation of the operator new, and that's it. It seems unlikely and counter productive that all language dump their runtime in there, and won't work when feature like C++ templates comes in....
2013 Mar 11
2
[LLVMdev] How to detect all free() calls
...: "Xi Wang"<xi.wang at gmail.com>; Date: Mon, Mar 11, 2013 12:24 PM To: "Jane"<270611649 at qq.com>; Cc: "llvmdev"<llvmdev at cs.uiuc.edu>; Subject: Re: [LLVMdev] How to detect all free() calls Try isFreeCall() defined in "llvm/Analysis/MemoryBuiltins.h". On Mon, Mar 11, 2013 at 12:17 AM, Jane <270611649 at qq.com> wrote: > > 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<CallI...
2013 Oct 29
1
[LLVMdev] Getting TargetData and TargetLibraryInfo for determining Malloc size
Hello; I was trying to use the computeArraySize() function from the MemoryBuiltins.cpp file. It requires two arguments DataLayout *TD and const TargetLibraryInfo *TLI. Can anyone tell me how to get the TargetLibraryInfo? I am getting the DataLayout using: DataLayout *TD; TD = new DataLayout(&M); I hope that's the right way of getting it. Thanks a lot; -- Arnamoy Bh...
2010 Dec 15
0
[LLVMdev] The best way to cope with AllocationInst type in old code?
...ct from the AllocationInst? Should I check for call > instructions to malloc? AllocationInst was a superclass of the AllocaInst and MallocInst, the latter of which was deleted so AllocationInst was removed. In LLVM, a lot of code was updated to use the isMalloc() out of include/llvm/Analysis/MemoryBuiltins.h, but "isa<AllocaInst>(...) || isMalloc(...)" would be closest to "isa<AllocationInst>(...)". Nick > I'm new to llvm and I would really appreciate any comment or suggestion. > > Thanks, > Hamid > _______________________________________________...
2010 Dec 15
2
[LLVMdev] The best way to cope with AllocationInst type in old code?
Hi all, I am working on some old code which was compiled against llvm-2.5. Anyway, in some places I, AllocationInst is used (e.g. to ensure the instruction's type). Even in your current documentation (http://llvm.org/docs/ProgrammersManual.html), I found an example that uses this instruction. If I got it correctly, this istruction (AllocationInst) has been removed from llvm instruction set.
2013 Mar 11
0
[LLVMdev] How to detect all free() calls
...;xi.wang at gmail.com>; > Date: Mon, Mar 11, 2013 12:24 PM > To: "Jane"<270611649 at qq.com>; > Cc: "llvmdev"<llvmdev at cs.uiuc.edu>; > Subject: Re: [LLVMdev] How to detect all free() calls > > Try isFreeCall() defined in "llvm/Analysis/MemoryBuiltins.h". > > On Mon, Mar 11, 2013 at 12:17 AM, Jane <270611649 at qq.com> wrote: >> >> 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: C...
2016 May 23
1
BoundsChecking Pass
...ement otherwise perf may suffer quite a bit. > Are you still working on it? If yes, what is it that you are trying to do? I would like to work on this Pass during summer (until end of August). That would be great if you could lead me a little bit =) > - The analysis code is in lib/Analysis/MemoryBuiltins.cpp > I have a question on this. As I read the code I was wondering how the run-time part was implemented. I was looking for something like a redefinition of malloc&free functions but I found no clue. Now I'm wondering if it's reduced to the run-time action of the ObjectSizeOffsetEv...
2016 May 22
0
BoundsChecking Pass
...re done before. - Sometimes LLVM transforms loops into intrinsics, like memcpy or memset. Right now these are not checked (but should, though) - Guards are mostly not hoisted out of loops by LLVM; this needs improvement otherwise perf may suffer quite a bit. - The analysis code is in lib/Analysis/MemoryBuiltins.cpp Hope this helps. Please let us know if you have more questions. Nuno -----Original Message----- From: Pierre Gagelin via llvm-dev Sent: Friday, May 20, 2016 11:16 AM To: llvm-dev at lists.llvm.org Subject: [llvm-dev] BoundsChecking Pass Hi, I am a final year French student doing an inter...
2013 Feb 26
2
[LLVMdev] Question about intrinsic function llvm.objectsize
...ate one of them, the assertion is triggered when the llvm::getObjectSize() is called by instcombine (instead of alias analyizer) in an attempt to replace llvm.objectsize() with a constant. I think the way llvm::getObjectSize() interpret "object" is wrong. Figure 1 cat -n lib/Analysis/MemoryBuiltins.cpp 344 bool llvm::getObjectSize(const Value *Ptr, uint64_t &Size, const DataLayout *TD, 345 const TargetLibraryInfo *TLI, bool RoundToAlign) { 346 if (!TD) 347 return false; 348 349 ObjectSizeOffsetVisitor Visitor(TD, TLI, Ptr->getContext...
2016 May 20
2
BoundsChecking Pass
Hi, I am a final year French student doing an internship at the University of Portsmouth. As I was taking hands on AddressSanitizer I took a look at BoundsChecking (both are in the lib/Transforms/Instrumentation folder). I found nothing on it except for the LLVM Documentation and references to BaggyBoundsCheck (which is not the same project. As far as I understood it is part of the SAFECode
2012 May 25
0
[LLVMdev] alloc_size metadata
...; Am I right that we're thinking the same thing, or did I completely misunderstand > you? no, I'm thinking that SAFECode won't need to look at or worry about the attribute at all, because the LLVM methods will know about it and serve up the appropriate info. Take a look at Analysis/MemoryBuiltins.h. In spite of the names, things like extractMallocCall are dealing with "malloc like" functions, such as C++'s "new" as well as malloc. Similarly for calloc. So you could use those right now to extract "malloc" and "calloc" sizes. If alloc_size is im...
2013 Feb 27
0
[LLVMdev] Question about intrinsic function llvm.objectsize
...riggered when the llvm::getObjectSize() is called > by instcombine (instead of alias analyizer) > in an attempt to replace llvm.objectsize() with a constant. I think > the way llvm::getObjectSize() interpret "object" is wrong. > > > Figure 1 > cat -n lib/Analysis/MemoryBuiltins.cpp > 344 bool llvm::getObjectSize(const Value *Ptr, uint64_t &Size, > const DataLayout *TD, > 345 const TargetLibraryInfo *TLI, bool > RoundToAlign) { > 346 if (!TD) > 347 return false; > 348 > 349 ObjectSizeOffsetVisitor...
2012 May 25
4
[LLVMdev] alloc_size metadata
On 5/25/12 2:16 AM, Duncan Sands wrote: > Hi John, > >>>> I'm implementing the alloc_size function attribute in clang. >>> does anyone actually use this attribute? And if they do, can it >>> really buy >>> them anything? How about "implementing" it by ignoring it! >> > ... >> >> Currently, SAFECode has a pass which
2012 Nov 11
1
[LLVMdev] Find size of memory pointer is pointing to
Hi, Can we find the size of memory a pointer is pointing to in LLVM. For example type *p = (type *)malloc(sizeof(type)*20); then it should give us size as sizeof(type) * 20. -- Sunil Rathee MTech IIT Delhi Not going along with the crowd can help you stand out in the crowd -------------- next part -------------- An HTML attachment was scrubbed... URL:
2012 Nov 12
0
[LLVMdev] Find size of memory pointer is pointing to
...r> > To: llvmdev at cs.uiuc.edu > Subject: Re: [LLVMdev] Find size of memory pointer is pointing to > Message-ID: <50A0C850.8050106 at free.fr> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi Sunil, you can do this using the routines in llvm/Analysis/MemoryBuiltins.h. These routines are useful to identify memory allocation points and other memory objects. If you want to determine the size for an arbitrary pointer in a program, though, the harder problem is propagating the size information from the allocation to a place where a pointer is used. This require...
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")
2013 Feb 27
4
[LLVMdev] Question about intrinsic function llvm.objectsize
...elow. >> in an attempt to replace llvm.objectsize() with a constant. I think the way llvm::getObjectSize() interpret "object" is wrong. >> No, it is behaving as expected depending on where you call it from. See below. >> >> Figure 1 >> cat -n lib/Analysis/MemoryBuiltins.cpp >> 344 bool llvm::getObjectSize(const Value *Ptr, uint64_t &Size, const DataLayout *TD, >> 345 const TargetLibraryInfo *TLI, bool RoundToAlign) { >> 346 if (!TD) >> 347 return false; >> 348 >> 349 ObjectSizeOffsetVis...
2010 Dec 15
1
[LLVMdev] The best way to cope with AllocationInst type in old code?
...t? Should I check for call >> instructions to malloc? > AllocationInst was a superclass of the AllocaInst and MallocInst, the > latter of which was deleted so AllocationInst was removed. > > In LLVM, a lot of code was updated to use the isMalloc() out of > include/llvm/Analysis/MemoryBuiltins.h, but "isa<AllocaInst>(...) || > isMalloc(...)" would be closest to "isa<AllocationInst>(...)". As a related aside, I've been thinking for awhile that it would be nice to have an allocator analysis group. Each pass in the analysis group would recognize th...
2013 Feb 27
0
[LLVMdev] Question about intrinsic function llvm.objectsize
...;>> in an attempt to replace llvm.objectsize() with a constant. I think the way llvm::getObjectSize() interpret "object" is wrong. >>> > No, it is behaving as expected depending on where you call it from. See below. >>> Figure 1 >>> cat -n lib/Analysis/MemoryBuiltins.cpp >>> 344 bool llvm::getObjectSize(const Value *Ptr, uint64_t &Size, const DataLayout *TD, >>> 345 const TargetLibraryInfo *TLI, bool RoundToAlign) { >>> 346 if (!TD) >>> 347 return false; >>> 348 >>&g...
2013 Feb 27
2
[LLVMdev] Question about intrinsic function llvm.objectsize
...ttempt to replace llvm.objectsize() with a constant. I think the way llvm::getObjectSize() interpret "object" is wrong. >>>> >> No, it is behaving as expected depending on where you call it from. See below. >>>> Figure 1 >>>> cat -n lib/Analysis/MemoryBuiltins.cpp >>>> 344 bool llvm::getObjectSize(const Value *Ptr, uint64_t &Size, const DataLayout *TD, >>>> 345 const TargetLibraryInfo *TLI, bool RoundToAlign) { >>>> 346 if (!TD) >>>> 347 return false; >>>>...