Index: llvm/docs/LangRef.rst =================================================================== --- llvm/docs/LangRef.rst +++ llvm/docs/LangRef.rst @@ -1066,6 +1066,28 @@ site. If the alignment is not specified, then the code generator makes a target-specific assumption. +.. _attr_inmem: + +``inmem()`` + + The ``inmem`` argument attribute allows specifying the pointee + memory type of an argument for ABI purposes. This is similar to + ``byval``, but does not imply a copy is made anywhere, or that the + argument is passed on the stack. This implies the pointer is + dereferenceable up to the storage size of the type. + + It is not generally permissible to introduce a write to an + ``inmem`` pointer, unless it is known this will not produce an + observable change in the caller. The pointer may have any address + space and may be read only. + + This is not a valid attribute for return values. + + The alignment for an ``inmem`` parameter can be explicitly + specified by combining it with the ``align`` attribute, similar to + ``byval``. If the alignment is not specified, then the code generator + makes a target-specific assumption. + .. _attr_preallocated: ``preallocated()`` Index: llvm/docs/ReleaseNotes.rst =================================================================== --- llvm/docs/ReleaseNotes.rst +++ llvm/docs/ReleaseNotes.rst @@ -74,6 +74,9 @@ information. This information is used to represent Fortran modules debug info at IR level. +* Added the ``inmem`` attribute to better represent argument passing + for the `amdgpu_kernel` calling convention. + Changes to building LLVM ------------------------ @@ -134,6 +137,9 @@ retain the old behavior should explicitly request f32 denormal flushing. +* The new ``inmem`` attribute is now the preferred method for + representing aggregate kernel arguments. + Changes to the AVR Target -----------------------------