[Mlir-commits] [mlir] ee77607 - [mlir][spirv] Include SPIR-V op definitions in main SPIR-V doc
Lei Zhang
llvmlistbot at llvm.org
Tue Mar 31 15:29:29 PDT 2020
Author: Lei Zhang
Date: 2020-03-31T18:29:17-04:00
New Revision: ee77607ca6ceaf13801bdb98307fd26c78fbc92a
URL: https://github.com/llvm/llvm-project/commit/ee77607ca6ceaf13801bdb98307fd26c78fbc92a
DIFF: https://github.com/llvm/llvm-project/commit/ee77607ca6ceaf13801bdb98307fd26c78fbc92a.diff
LOG: [mlir][spirv] Include SPIR-V op definitions in main SPIR-V doc
Differential Revision: https://reviews.llvm.org/D77174
Added:
Modified:
mlir/docs/Dialects/SPIR-V.md
mlir/include/mlir/Dialect/SPIRV/CMakeLists.txt
Removed:
################################################################################
diff --git a/mlir/docs/Dialects/SPIR-V.md b/mlir/docs/Dialects/SPIR-V.md
index 20919c08244b..acf56f137e16 100644
--- a/mlir/docs/Dialects/SPIR-V.md
+++ b/mlir/docs/Dialects/SPIR-V.md
@@ -15,6 +15,8 @@ Vulkan and OpenCL. It is fully defined in a
[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 @@ can be represented in the dialect as
```
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 @@ conversion][MlirDialectConversionSignatureConversion] might be needed as well.
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 @@ dialect.
[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
index 771d4c1a43bb..2ffddf829854 100644
--- 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)
More information about the Mlir-commits
mailing list