[PATCH] Remove dead zero store to calloc initialized memory

Reid Kleckner rnk at google.com
Thu May 29 13:55:46 PDT 2014


On Thu, May 29, 2014 at 11:53 AM, Philip Reames <listmail at philipreames.com>
wrote:

> (Again, this doesn't appear to have gone to the commits list.  Anyone have
> a clue what's I'm doing wrong here?)
>

There was a behavior change when phab moved to reviews.llvm.org.  Now it
doesn't send mail when you add a "subscriber" to the issue.  This is
unfortunate and I'd be happy if it were fixed, but until then I try to make
sure I create the issue with llvm-commits in the subscriber field before
submitting it.  Using 'arc' from the command line makes this easy, but I
know it isn't everyone's cup of tea.


> Remove dead zero store to calloc initialized memory
>
> http://reviews.llvm.org/D3942
>
> Optimize the following IR:
>
> %1  =  tail  call  noalias  i8*  @calloc(i64  1,  i64  4)
> %2  =  bitcast  i8*  %1  to  i32*
> ;  This  store  is  dead  and  should  be  removed
> store  i32  0,  i32*  %2,  align  4
>
> Memory returned by calloc is guaranteed to be zero initialized. If the
> value being stored is the constant zero (and the store is not otherwise
> observable across threads), we can delete the store.
>
> Note: I do not have commit rights and will need someone to commit this
> change after review.
>
> Philip
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140529/338df3e7/attachment.html>


More information about the llvm-commits mailing list