[llvm-dev] [RFC] Adding a globalmemonly attribute for functions that only access global memory

James Y Knight via llvm-dev llvm-dev at lists.llvm.org
Tue Sep 14 11:27:44 PDT 2021


On Tue, Sep 14, 2021 at 2:03 PM Philip Reames via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> In fact, the original motivation for the globalmemonly proposal could be
> alternatively solved with:
>
> @errno = external global i32
>
> declare void @mathfunc(float, float) globalmayalias(@errno)


How would that work, since errno generally isn't a global (or a
compiler-supported thread-local)? It's typically something along the lines
of:
  int* __errno_location(void) __attribute__((const));
  #define errno *__errno_location()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20210914/a44fb699/attachment.html>


More information about the llvm-dev mailing list