William Moses via llvm-dev
2020-Jan-03 19:11 UTC
[llvm-dev] Attribute for Function that does not write to memory that outlives itself
Hi all, Is there a function attribute or otherwise way to query whether a function could write to memory that outlives itself? For example writing to a global or memory passed in via a function argument would be writing to memory that outlives the function, but writing to a stack variable or allocation that isn't returned would not. Cheers, Billy Moses -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200103/955d7071/attachment.html>
Alex Brachet-Mialot via llvm-dev
2020-Jan-03 19:19 UTC
[llvm-dev] Attribute for Function that does not write to memory that outlives itself
Pure or const are similar to what you want but not exactly the same to what you’re describing. On Fri, Jan 3, 2020 at 2:12 PM William Moses via llvm-dev < llvm-dev at lists.llvm.org> wrote:> Hi all, > > Is there a function attribute or otherwise way to query whether a function > could write to memory that outlives itself? > > For example writing to a global or memory passed in via a function > argument would be writing to memory that outlives the function, but writing > to a stack variable or allocation that isn't returned would not. > > Cheers, > Billy Moses > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200103/06d6ab4f/attachment.html>
Doerfert, Johannes via llvm-dev
2020-Jan-03 20:05 UTC
[llvm-dev] Attribute for Function that does not write to memory that outlives itself
LLVM-IR: readnone/readonly/writeonly on functions is almost what you want. They basically that from the perspective of the caller there is no visible access/write/read. On 01/03, Alex Brachet-Mialot via llvm-dev wrote:> Pure or const are similar to what you want but not exactly the same to what > you’re describing. > > On Fri, Jan 3, 2020 at 2:12 PM William Moses via llvm-dev < > llvm-dev at lists.llvm.org> wrote: > > > Hi all, > > > > Is there a function attribute or otherwise way to query whether a function > > could write to memory that outlives itself? > > > > For example writing to a global or memory passed in via a function > > argument would be writing to memory that outlives the function, but writing > > to a stack variable or allocation that isn't returned would not. > > > > Cheers, > > Billy Moses > > _______________________________________________ > > LLVM Developers mailing list > > llvm-dev at lists.llvm.org > > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev > >> _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev-- Johannes Doerfert Researcher Argonne National Laboratory Lemont, IL 60439, USA jdoerfert at anl.gov -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 228 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200103/78b4c2f6/attachment.sig>