Add mechanism to specify extended instruction sets in SPIR-V.
authorMahesh Ravishankar <ravishankarm@google.com>
Mon, 16 Sep 2019 02:39:28 +0000 (19:39 -0700)
committerA. Unique TensorFlower <gardener@tensorflow.org>
Mon, 16 Sep 2019 02:40:07 +0000 (19:40 -0700)
commit9814b3fa0ddc497f215813ca261dc97214e53295
treea389105b633e50cecb25ab93c20b1b92f73cf015
parentfaaa1ced1002acef661cfd352c32c1cb86c22726
Add mechanism to specify extended instruction sets in SPIR-V.

Add support for specifying extended instructions sets. The operations
in SPIR-V dialect are named as 'spv.<extension-name>.<op-name>'. Use
this mechanism to define a 'Exp' operation from GLSL(450)
instructions.
Later CLs will add support for (de)serialization of these operations,
and update the dialect generation scripts to auto-generate the
specification using the spec directly.

Additional changes:
Add a Type Constraint to OpBase.td to check for vector of specified
lengths. This is used to check that the vector type used in SPIR-V
dialect are of lengths 2, 3 or 4.
Update SPIRVBase.td to use this Type constraints for vectors.

PiperOrigin-RevId: 269234377
mlir/include/mlir/Dialect/SPIRV/CMakeLists.txt
mlir/include/mlir/Dialect/SPIRV/SPIRVBase.td
mlir/include/mlir/Dialect/SPIRV/SPIRVGLSLOps.h [new file with mode: 0644]
mlir/include/mlir/Dialect/SPIRV/SPIRVGLSLOps.td [new file with mode: 0644]
mlir/include/mlir/IR/OpBase.td
mlir/lib/Conversion/StandardToSPIRV/StandardToSPIRV.td
mlir/lib/Dialect/SPIRV/CMakeLists.txt
mlir/lib/Dialect/SPIRV/SPIRVDialect.cpp
mlir/lib/Dialect/SPIRV/SPIRVGLSLOps.cpp [new file with mode: 0644]
mlir/test/Dialect/SPIRV/glslops.mlir [new file with mode: 0644]