Skip to content

Commit 596be30

Browse files
author
root
committed
[Documentation] Update parameter and function attribute in LangRef
Update the documentation for parameter and function attributes to include support for target-dependent string attributes.
1 parent 828467a commit 596be30

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

llvm/docs/LangRef.rst

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1161,15 +1161,17 @@ parameters of a function. Parameter attributes are considered to be part
11611161
of the function, not of the function type, so functions with different
11621162
parameter attributes can have the same function type.
11631163

1164-
Parameter attributes are simple keywords that follow the type specified.
1165-
If multiple parameter attributes are needed, they are space separated.
1166-
For example:
1164+
Parameter attributes are simple keywords that follow the specified type.
1165+
When multiple parameter attributes are required, they are separated by
1166+
spaces. Additionally, target-dependent attributes can be provided as a
1167+
string. For example:
11671168

11681169
.. code-block:: llvm
11691170

11701171
declare i32 @printf(ptr noalias nocapture, ...)
11711172
declare i32 @atoi(i8 zeroext)
11721173
declare signext i8 @returns_signed_char()
1174+
define void @baz(i32 "amdgpu-flat-work-group-size"="1,256" %x)
11731175

11741176
Note that any attributes for the function result (``nonnull``,
11751177
``signext``) come before the result type.
@@ -1843,16 +1845,18 @@ a function. Function attributes are considered to be part of the
18431845
function, not of the function type, so functions with different function
18441846
attributes can have the same function type.
18451847

1846-
Function attributes are simple keywords that follow the type specified.
1847-
If multiple attributes are needed, they are space separated. For
1848-
example:
1848+
Function attributes are simple keywords that follow the specified type.
1849+
When multiple attributes are required, they are separated by spaces.
1850+
Additionally, target-dependent attributes can be provided as a string.
1851+
For example:
18491852

18501853
.. code-block:: llvm
18511854

18521855
define void @f() noinline { ... }
18531856
define void @f() alwaysinline { ... }
18541857
define void @f() alwaysinline optsize { ... }
18551858
define void @f() optsize { ... }
1859+
define void @f() "no-sse" { ... }
18561860

18571861
``alignstack(<n>)``
18581862
This attribute indicates that, when emitting the prologue and

0 commit comments

Comments
 (0)