diff --git a/docs/SPIRVRepresentationInLLVM.rst b/docs/SPIRVRepresentationInLLVM.rst index 94c66b3f87..14e99985be 100644 --- a/docs/SPIRVRepresentationInLLVM.rst +++ b/docs/SPIRVRepresentationInLLVM.rst @@ -184,7 +184,7 @@ The unmangled names of SPIR-V builtin BuildNDRange functions follow the conventi __spirv_{BuildNDRange}_{1|2|3}D SPIR-V 1.1 Builtin CreatePipeFromPipeStorage Function Name ----------------------------------------- +---------------------------------------------------------- The unmangled names of SPIR-V builtin CreatePipeFromPipeStorage function follow the convention: @@ -213,7 +213,7 @@ starts with two underscores to facilitate identification since extended instruct may contain underscore. The remaining postfixes start with one underscore. OpenCL Extended Builtin Vector Load Function Names ----------------------------------------- +-------------------------------------------------- The unmangled names of OpenCL extended vector load functions follow the convention: @@ -422,7 +422,7 @@ are translated for image types, but they should be encoded in LLVM IR type name rather than function metadata. Function parameter, instruction and global variable decoration through metadata ------------------------------------------------------------------- +------------------------------------------------------------------------------- Function parameters, instructions and global variables can be decorated using LLVM metadata through the metadata names ``spirv.ParameterDecorations`` and @@ -483,6 +483,26 @@ extra operands ``i32 1`` and ``i32 2``. decorates the argument ``b`` of ``k`` with ``Restrict`` in SPIR-V while not adding any decoration to argument ``a``. +Loop controls and loop metadata +------------------------------- + +SPIR-V Loop controls that do not have corresponding `llvm.loop` metadata +can be decorated using LLVM metadata through the names +``spirv.loop.`` where ``LoopControlID`` corresponds to the name +of the SPIR-V loop control. This metadata should be applied to the latch-block's +branch instruction. + +An example with the ``DependencyAccessesINTEL`` loop control: + +.. code-block:: llvm + + br i1 %cond, label %loop, label %exit !spirv.loop.dependency_accesses !4 + ... + !1 = distinct !{} ; metadata corresponding to distinct access group + !2 = distinct !{} ; metadata corresponding to distinct access group + !3 = distinct !{} ; metadata corresponding to distinct access group + !4 = !{!0, !1, !2, 0} ; metadata node grouping access groups for the corresponding DepenencyAccessesINTEL instance + Member decoration through pointer annotations ---------------------------------------------