diff options
Diffstat (limited to 'llvm/docs/LangRef.rst')
-rw-r--r-- | llvm/docs/LangRef.rst | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst index d61ea07..0429c947 100644 --- a/llvm/docs/LangRef.rst +++ b/llvm/docs/LangRef.rst @@ -877,7 +877,9 @@ an optional ``unnamed_addr`` attribute, a return type, an optional name, a (possibly empty) argument list (each with optional :ref:`parameter attributes <paramattrs>`), optional :ref:`function attributes <fnattrs>`, an optional address space, an optional section, an optional partition, -an optional alignment, an optional :ref:`comdat <langref_comdats>`, +an optional minimum alignment, +an optional preferred alignment, +an optional :ref:`comdat <langref_comdats>`, an optional :ref:`garbage collector name <gc>`, an optional :ref:`prefix <prefixdata>`, an optional :ref:`prologue <prologuedata>`, an optional :ref:`personality <personalityfn>`, @@ -891,8 +893,8 @@ Syntax:: <ResultType> @<FunctionName> ([argument list]) [(unnamed_addr|local_unnamed_addr)] [AddrSpace] [fn Attrs] [section "name"] [partition "name"] [comdat [($name)]] [align N] - [gc] [prefix Constant] [prologue Constant] [personality Constant] - (!name !N)* { ... } + [prefalign N] [gc] [prefix Constant] [prologue Constant] + [personality Constant] (!name !N)* { ... } The argument list is a comma-separated sequence of arguments where each argument is of the following form: @@ -942,11 +944,20 @@ LLVM allows an explicit section to be specified for functions. If the target supports it, it will emit functions to the section specified. Additionally, the function can be placed in a COMDAT. -An explicit alignment may be specified for a function. If not present, -or if the alignment is set to zero, the alignment of the function is set -by the target to whatever it feels convenient. If an explicit alignment -is specified, the function is forced to have at least that much -alignment. All alignments must be a power of 2. +An explicit minimum alignment (``align``) may be specified for a +function. If not present, or if the alignment is set to zero, the +alignment of the function is set according to the preferred alignment +rules described below. If an explicit minimum alignment is specified, the +function is forced to have at least that much alignment. All alignments +must be a power of 2. + +An explicit preferred alignment (``prefalign``) may also be specified for +a function (definitions only, and must be a power of 2). If a function +does not have a preferred alignment attribute, the preferred alignment +is determined in a target-specific way. The preferred alignment, if +provided, is treated as a hint; the final alignment of the function will +generally be set to a value somewhere between the minimum alignment and +the preferred alignment. If the ``unnamed_addr`` attribute is given, the address is known to not be significant and two identical functions can be merged. |