Index: llvm/docs/LangRef.rst =================================================================== --- llvm/docs/LangRef.rst +++ llvm/docs/LangRef.rst @@ -1066,6 +1066,30 @@ site. If the alignment is not specified, then the code generator makes a target-specific assumption. +.. _attr_byref: + +``byref()`` + + The ``byref`` argument attribute allows specifying the pointee + memory type of an argument. 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 + ``byref`` pointer. 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 ``byref`` 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. + + This is intended for representing ABI constraints, and is not + intended to be inferred for optimization use. + .. _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 ``byref`` 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 ``byref`` attribute is now the preferred method for + representing aggregate kernel arguments. + Changes to the AVR Target -----------------------------