[mlir][spirv][doc] Remove duplicate syntax formats (#73386)
commit56cf3ff479ab70b4d802f935afa64a343b402a73
authorRik Huijzer <github@huijzer.xyz>
Mon, 27 Nov 2023 10:17:07 +0000 (27 11:17 +0100)
committerGitHub <noreply@github.com>
Mon, 27 Nov 2023 10:17:07 +0000 (27 11:17 +0100)
tree8e55be5b186884938f7faf29ed58840170c289a3
parent272085f10bfaa33349682a9e4d08c990c159355d
[mlir][spirv][doc] Remove duplicate syntax formats (#73386)

Some operations defined their syntax both in the documentation and via
`assemblyFormat`. This leads to two syntax descriptions in the
documentation for SPIR-V, see for example the documentation for
[`spirv.mlir.yield`](https://mlir.llvm.org/docs/Dialects/SPIR-V/#spirvmliryield-spirvyieldop).
Since the `assemblyFormat` is used to generate the actual parsers and
printer implementations, this PR removes the manual syntax descriptions.
(Similar to https://github.com/llvm/llvm-project/pull/73343.)

The strategy that I used to find the duplicates was pretty
uncomplicated. I scrolled through the [SPIR-V
Dialect](https://mlir.llvm.org/docs/Dialects/SPIR-V) to find all
duplicates and then remove the duplicate text from the `td` file.

Note that the `Syntax:` block in the docs is a good proxy for whether
`assemblyFormat` is defined because it will only be generated if the op
has defined `assemblyFormat` (`op.hasAssemblyFormat()`):

https://github.com/llvm/llvm-project/blob/e970652776bd07dbe42be557bf98722749230653/mlir/tools/mlir-tblgen/OpDocGen.cpp#L108-L124

https://github.com/llvm/llvm-project/blob/e970652776bd07dbe42be557bf98722749230653/mlir/tools/mlir-tblgen/OpDocGen.cpp#L197-L199

Related issue https://github.com/llvm/llvm-project/issues/73359.
18 files changed:
mlir/include/mlir/Dialect/SPIRV/IR/SPIRVArithmeticOps.td
mlir/include/mlir/Dialect/SPIRV/IR/SPIRVBarrierOps.td
mlir/include/mlir/Dialect/SPIRV/IR/SPIRVBitOps.td
mlir/include/mlir/Dialect/SPIRV/IR/SPIRVCLOps.td
mlir/include/mlir/Dialect/SPIRV/IR/SPIRVCastOps.td
mlir/include/mlir/Dialect/SPIRV/IR/SPIRVCompositeOps.td
mlir/include/mlir/Dialect/SPIRV/IR/SPIRVControlFlowOps.td
mlir/include/mlir/Dialect/SPIRV/IR/SPIRVCooperativeMatrixOps.td
mlir/include/mlir/Dialect/SPIRV/IR/SPIRVGLOps.td
mlir/include/mlir/Dialect/SPIRV/IR/SPIRVGroupOps.td
mlir/include/mlir/Dialect/SPIRV/IR/SPIRVImageOps.td
mlir/include/mlir/Dialect/SPIRV/IR/SPIRVIntelExtOps.td
mlir/include/mlir/Dialect/SPIRV/IR/SPIRVJointMatrixOps.td
mlir/include/mlir/Dialect/SPIRV/IR/SPIRVLogicalOps.td
mlir/include/mlir/Dialect/SPIRV/IR/SPIRVMatrixOps.td
mlir/include/mlir/Dialect/SPIRV/IR/SPIRVMiscOps.td
mlir/include/mlir/Dialect/SPIRV/IR/SPIRVNonUniformOps.td
mlir/include/mlir/Dialect/SPIRV/IR/SPIRVStructureOps.td