[PATCH] D72798: [llvm][docs] LangRef for IR attribute `vector-function-abi-variants`.
Francesco Petrogalli via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 15 12:05:09 PST 2020
fpetrogalli created this revision.
fpetrogalli added reviewers: jdoerfert, andwar.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D72798
Files:
llvm/docs/LangRef.rst
Index: llvm/docs/LangRef.rst
===================================================================
--- llvm/docs/LangRef.rst
+++ llvm/docs/LangRef.rst
@@ -1841,6 +1841,69 @@
function has not changed between the function prolog and eiplog. It is
currently x86_64-specific.
+Instruction Attributes
+----------------------
+
+Attributes may be attached to instrucions. The following instruction
+attributes are supported.
+
+``vector-function-abi-variants``
+ This attribute can be attached to a CallInst to list the vector
+ function that can be used to vectorize calls to the scalar
+ function. The Attribute consists of a comma separated list of
+ mangled names. The syntax for the mangled names is as follows:
+
+ _ZGV<isa><mask><vlen><parameters>_<scalar_name>{(<vector_redirection>)}
+
+ When present, the attribute informs the compiler that the function
+ ``<scalar_name>`` has a correspondent vector variant that can be
+ used to perform the concurrent invocation of ``<scalar_name>`` on
+ vectors. The shape of the vector function is described by the
+ tokens between the prefix ``_ZGV`` and the ``<scalar_name>``
+ token. The standard name of the vector function is
+ ``_ZGV<isa><mask><vlen><parameters>_<scalar_name>``. When present,
+ the optional ``(<vector_redirection>)`` informs the compiler that
+ a custom name is provided instead of the standard one
+ ``_ZGV<isa><mask><vlen><parameters>_<scalar_name>``. The
+ definition or declaration of the variant must be present in the IR
+ Module. The signature of the vector variant is determined by the
+ rules of the Vector Function ABI (VFABI) specifications of the
+ target. For Arm and X86, the VFABI can be found at
+ https://github.com/ARM-software/software-standards and
+ https://software.intel.com/en-us/articles/vector-simd-function-abi,
+ respectively.
+
+ For X86 and Arm targets, the values of the tokens in the standard
+ name are those that are defined in the VFABI. The same tokens of
+ X86 and Arm are used to represent the Internal LLVM Vector Isa
+ when ``<isa> = __LLVM__``.
+
+ The tokens are expand as follows:
+
+ <isa>:= b | c | d | e -> X86 SSE, AVX, AVX2, AVX512
+ | n | s -> Armv8 Advanced SIMD, SVE
+ | __LLVM__ -> Internal LLVM Vector ISA
+
+ <mask>:= M | N -> mask | no mask
+
+ <vlen>:= number -> number of lanes
+ | x -> VLA (Vector Length Agnostic)
+
+ <parameters>:= v -> vector
+ | l | l <number> -> linear
+ | R | R <number> -> linear with ref modifier
+ | L | L <number> -> linear with val modifier
+ | U | U <number> -> linear with uval modifier
+ | ls <pos> -> runtime linear
+ | Rs <pos> -> runtime linear with ref modifier
+ | Ls <pos> -> runtime linear with val modifier
+ | Us <pos> -> runtime linear with uval modifier
+ | u -> uniform
+
+ <scalar_name>:= name of the scalar function
+
+ <vector_redirection>:= optional, custom name of the vector function
+
.. _glattrs:
Global Attributes
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D72798.238330.patch
Type: text/x-patch
Size: 3274 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200115/2c38a8c7/attachment.bin>
More information about the llvm-commits
mailing list