Displaying 6 results from an estimated 6 matches for "my_malloc".
Did you mean:
my_calloc
2017 Apr 30
2
allocsize: change from 3.9 to 4.0
Hi all,
I added support for the allocsize function attribute to our compiler
(LDC), thinking that that would enable removal of function calls when the
allocated memory is not used.
For example:
```
declare i8* @my_malloc(i32) allocsize(0)
define void @test_malloc() {
%1 = call i8* @my_malloc(i32 100)
ret void
}
```
I thought the my_alloc call in test_malloc would be removed, but `opt -O3`
doesn't do that (LLVM 4.0 and trunk). However, LLVM3.9's `opt` _does_
remove the call.
I can't find out why th...
2012 May 29
1
[LLVMdev] alloc_size metadata
...ve in
> optimizing based on this metadata.
> For example, do we really want to remove a call to a custom
> allocator whose return value is unused (like we do for malloc)? If
> so, we'll also need a metadata node to mark de-allocation functions
> (so that sequences like my_free(my_malloc(xx)) are removed).
You might want to restrict that to custom allocators that have an
additional 'removable' attribute.
Out of curiosity, does any of this potentially effect the presence or
absence of 'inbounds' on GEP instructions?
Thanks again,
Hal
>
> Any feedback on th...
2012 May 29
0
[LLVMdev] alloc_size metadata
...d be very aggressive in
optimizing based on this metadata.
For example, do we really want to remove a call to a custom allocator
whose return value is unused (like we do for malloc)? If so, we'll
also need a metadata node to mark de-allocation functions (so that
sequences like my_free(my_malloc(xx)) are removed).
Any feedback on the issues described is highly appreciated!
Thanks,
Nuno
2012 May 25
3
[LLVMdev] alloc_size metadata
On Fri, 25 May 2012 17:43:52 +0200
Duncan Sands <baldrick at free.fr> wrote:
> Hi John,
>
> On 25/05/12 17:22, John Criswell wrote:
> > 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
2012 May 29
2
[LLVMdev] alloc_size metadata
...d (like we do for malloc)?
No we don't, so LLVM's interface to malloc-like and calloc-like things would
have to be reworked to extract out different kinds of knowledge.
If so, we'll
> also need a metadata node to mark de-allocation functions (so that
> sequences like my_free(my_malloc(xx)) are removed).
Maybe!
Ciao, Duncan.
2012 May 29
0
[LLVMdev] alloc_size metadata
...we don't, so LLVM's interface to malloc-like and calloc-like
> things would have to be reworked to extract out different kinds of
> knowledge.
>
> If so, we'll
> > also need a metadata node to mark de-allocation functions (so that
> > sequences like my_free(my_malloc(xx)) are removed).
>
> Maybe!
>
> Ciao, Duncan.
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
--
Hal Finkel
Postdoctoral Appo...