[PATCH] D117571: [LangRef] Clarify that inaccessiblememonly functions are allowed noalias returns

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 18 09:17:01 PST 2022


reames created this revision.
reames added reviewers: nikic, xbolva00, Bryce-MW.
Herald added subscribers: jeroen.dobbelaere, jdoerfert, bollu, mcrosier.
reames requested review of this revision.
Herald added a project: LLVM.

Confusion over this point came up in a couple of recent changes (D117180 <https://reviews.llvm.org/D117180>, e20b32ff3 <https://reviews.llvm.org/rGe20b32ff3b029f50c7237f49e5e5c97bd47ea540>).  Current tone of discussion seems to be that we think inaccessiblememonly was always legal on allocation functions, so this change takes the form of a clarification instead of a change.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D117571

Files:
  llvm/docs/LangRef.rst


Index: llvm/docs/LangRef.rst
===================================================================
--- llvm/docs/LangRef.rst
+++ llvm/docs/LangRef.rst
@@ -1633,9 +1633,14 @@
     on all the hot functions.
 ``inaccessiblememonly``
     This attribute indicates that the function may only access memory that
-    is not accessible by the module being compiled. This is a weaker form
-    of ``readnone``. If the function reads or writes other memory, the
-    behavior is undefined.
+    is not accessible by the module being compiled before return from the
+    function. This is a weaker form of ``readnone``. If the function reads
+    or writes other memory, the behavior is undefined.
+
+    For clarity, note that such functions are allowed to return new memory
+    which is ``noalias`` with respect to memory already accessible from
+    the module.  That is, a callee can be both ``inaccessiblememonly`` and
+    have a ``noalias`` return which introduces a new allocation.
 ``inaccessiblemem_or_argmemonly``
     This attribute indicates that the function may only access memory that is
     either not accessible by the module being compiled, or is pointed to


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D117571.400869.patch
Type: text/x-patch
Size: 1167 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220118/bc73e34a/attachment.bin>


More information about the llvm-commits mailing list