[llvm] [Documentation] Update parameter and function attribute section in LangRef (PR #114007)
Rajat Bajpai via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 28 23:28:15 PDT 2024
https://github.com/rajatbajpai created https://github.com/llvm/llvm-project/pull/114007
Update the documentation for parameter and function attributes to include support for target-dependent string attributes.
>From 596be30188f701240d8b5924cdcc1d5dfc7e7b8a Mon Sep 17 00:00:00 2001
From: root <root at 1u1g-x570-0025.pdcu2.colossus.nvidia.com>
Date: Tue, 29 Oct 2024 06:18:32 +0000
Subject: [PATCH] [Documentation] Update parameter and function attribute in
LangRef
Update the documentation for parameter and function attributes to
include support for target-dependent string attributes.
---
llvm/docs/LangRef.rst | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst
index f9ec33da1b651b..f7e619cc14a24e 100644
--- a/llvm/docs/LangRef.rst
+++ b/llvm/docs/LangRef.rst
@@ -1161,15 +1161,17 @@ parameters of a function. Parameter attributes are considered to be part
of the function, not of the function type, so functions with different
parameter attributes can have the same function type.
-Parameter attributes are simple keywords that follow the type specified.
-If multiple parameter attributes are needed, they are space separated.
-For example:
+Parameter attributes are simple keywords that follow the specified type.
+When multiple parameter attributes are required, they are separated by
+spaces. Additionally, target-dependent attributes can be provided as a
+string. For example:
.. code-block:: llvm
declare i32 @printf(ptr noalias nocapture, ...)
declare i32 @atoi(i8 zeroext)
declare signext i8 @returns_signed_char()
+ define void @baz(i32 "amdgpu-flat-work-group-size"="1,256" %x)
Note that any attributes for the function result (``nonnull``,
``signext``) come before the result type.
@@ -1843,9 +1845,10 @@ a function. Function attributes are considered to be part of the
function, not of the function type, so functions with different function
attributes can have the same function type.
-Function attributes are simple keywords that follow the type specified.
-If multiple attributes are needed, they are space separated. For
-example:
+Function attributes are simple keywords that follow the specified type.
+When multiple attributes are required, they are separated by spaces.
+Additionally, target-dependent attributes can be provided as a string.
+For example:
.. code-block:: llvm
@@ -1853,6 +1856,7 @@ example:
define void @f() alwaysinline { ... }
define void @f() alwaysinline optsize { ... }
define void @f() optsize { ... }
+ define void @f() "no-sse" { ... }
``alignstack(<n>)``
This attribute indicates that, when emitting the prologue and
More information about the llvm-commits
mailing list