[MLIR][SPIRV] Add initial support for OpSpecConstantOp.
authorergawy <kareem.ergawy@gmail.com>
Tue, 8 Dec 2020 14:02:02 +0000 (09:02 -0500)
committerLei Zhang <antiagainst@google.com>
Tue, 8 Dec 2020 14:07:52 +0000 (09:07 -0500)
commit6c69d3d68e9a4438b47422e49c0f2d69e2b8e1b7
tree56e426f7d7751e3b7d1346a1690faeba11277614
parent91fb9eac0b562cdfdc6b677f8ab2ee67f1ae1a77
[MLIR][SPIRV] Add initial support for OpSpecConstantOp.

This commit adds initial support for SPIR-V OpSpecConstantOp
instruction. The following is introdcued:

- A new `spv.specConstantOperation` operation consisting of a single
region and of 2 operations within that regions (more details in the
docs of the op itself).
- A new `spv.yield` instruction that acts a terminator for
`spv.specConstantOperation`.

For now, the generic form of the new op is supported (i.e. no custom
parsing or printing). This will be done in a follow up patch.

Reviewed By: antiagainst

Differential Revision: https://reviews.llvm.org/D92232
mlir/include/mlir/Dialect/SPIRV/SPIRVStructureOps.td
mlir/lib/Dialect/SPIRV/SPIRVOps.cpp
mlir/test/Dialect/SPIRV/structure-ops.mlir