[PATCH] D102348: [Instructions]: Calls marked with inaccessiblememonly attribute should be considered to not read/write memory

Ettore Tiotto via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 12 13:27:28 PDT 2021


etiotto added a comment.

In D102348#2754951 <https://reviews.llvm.org/D102348#2754951>, @bmahjour wrote:

> I'm not exactly sure what it means to "access memory that is not accessible by the module being compiled.". My guess is that it's for things like intrinsics that take a global string as argument (eg. the file name), for compile-time mapping, but don't get lowered to any instructions that actually access that memory in the final generated assembly. Is that correct, or are there other examples to consider?

I copied this from the LLVM manual definition. From this thread in the LLVM mailing list (https://lists.llvm.org/pipermail/llvm-dev/2019-April/131893.html):

  > So what kind of function can be annotated with this attribute,
  > functions which malloc heap memory and free it within the same scope?
  
  Short answer: Yes, we probably could but do not do it right now. Longer
  answer below. Also consider the use case of (known) function defined in
  another translation unit (=module). They could then even work on some
  global state, e.g., a global variable, if it never "leaks" out of the
  other scope.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D102348/new/

https://reviews.llvm.org/D102348



More information about the llvm-commits mailing list