diff --git a/mlir/docs/Dialects/SPIR-V.md b/mlir/docs/Dialects/SPIR-V.md --- a/mlir/docs/Dialects/SPIR-V.md +++ b/mlir/docs/Dialects/SPIR-V.md @@ -15,6 +15,8 @@ [human-readable specification][SpirvSpec]; the syntax of various SPIR-V instructions are encoded in a [machine-readable grammar][SpirvGrammar]. +[TOC] + ## Design Guidelines SPIR-V is a binary intermediate language that serves dual purpose: on one side, @@ -459,8 +461,9 @@ ``` Operation documentation is written in each op's Op Definition Spec using -TableGen. A markdown version of the doc can be found at -[mlir.llvm.org][LlvmMlirSpirvDoc] or generated using `mlir-tblgen -gen-doc`. +TableGen. A markdown version of the doc can be generated using +`mlir-tblgen -gen-doc` and is attached in the +[Operation definitions](#operation-definitions) section. ### Ops from extended instruction sets @@ -1224,6 +1227,10 @@ operations contained within its region are valid operations in the SPIR-V dialect. +## Operation definitions + +[include "Dialects/SPIRVOps.md"] + [Spirv]: https://www.khronos.org/registry/spir-v/ [SpirvSpec]: https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html [SpirvLogicalLayout]: https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_logicallayout_a_logical_layout_of_a_module @@ -1270,7 +1277,6 @@ [GitHubDialectTracking]: https://github.com/tensorflow/mlir/issues/302 [GitHubLoweringTracking]: https://github.com/tensorflow/mlir/issues/303 [GenSpirvUtilsPy]: https://github.com/llvm/llvm-project/blob/master/mlir/utils/spirv/gen_spirv_dialect.py -[LlvmMlirSpirvDoc]: ../Dialects/SPIRVOps/ [CustomTypeAttrTutorial]: ../DefiningAttributesAndTypes/ [VulkanSpirv]: https://renderdoc.org/vkspec_chunked/chap40.html#spirvenv [VulkanShaderInterface]: https://renderdoc.org/vkspec_chunked/chap14.html#interfaces-resources diff --git a/mlir/include/mlir/Dialect/SPIRV/CMakeLists.txt b/mlir/include/mlir/Dialect/SPIRV/CMakeLists.txt --- a/mlir/include/mlir/Dialect/SPIRV/CMakeLists.txt +++ b/mlir/include/mlir/Dialect/SPIRV/CMakeLists.txt @@ -1,5 +1,5 @@ add_mlir_dialect(SPIRVOps spv) -add_mlir_doc(SPIRVOps -gen-dialect-doc SPIRVDialect Dialects/) +add_mlir_doc(SPIRVOps -gen-op-doc SPIRVOps Dialects/) set(LLVM_TARGET_DEFINITIONS SPIRVBase.td) mlir_tablegen(SPIRVEnums.h.inc -gen-enum-decls)