[PATCH] D46240: [llvm] Removing writeonly and readnone incompatibility.

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 30 19:38:55 PDT 2018


reames added a comment.

In https://reviews.llvm.org/D46240#1083286, @homerdin wrote:

> I am working to enable functions that only write to memory to be hoisted out of loops and to combined by EarlyCSE, more specifically I am working to mark the math functions that only write to errno as writeonly then have them handled as writeonly functions.


You'll need something a bit stronger than an aliasing property.  You're going to specifically need to model *what* is written to errno.  At the moment, we don't have a good way to model a function which writes only to one specific global (errno) or to model what those writes are.

One thing you could explore is to build in "DSE" for builtin functions.  Once you got a basic design worked out in rough patch form, we could look to see what attributes might make sense to extract.

> It seems I was mislead by the name readnone, when it is intended as read none and write no visible state.

readnone is intended to be the intersection of readonly and writeonly.   Naming wise, readnone pre-existed the existence of writeonly.

> I will abandon this change and look to see why functions are being marked as both writeonly and readnone with my changes when the function writes.
> 
> Any thoughts on how we can enable the changes I am working towards would be appreciated.

See above.  I'd start this by working with builtin's via TLI and DSE, then go from there.


https://reviews.llvm.org/D46240





More information about the llvm-commits mailing list