summaryrefslogtreecommitdiffstats
path: root/mlir/include
diff options
context:
space:
mode:
authorLei Zhang <antiagainst@google.com>2020-01-03 07:37:19 -0500
committerLei Zhang <antiagainst@google.com>2020-01-03 07:44:27 -0500
commitb3d286776941aef765f8858d95f80808b528f2fa (patch)
treea0d05d18d416836830d949ce3deb58add6e772e8 /mlir/include
parentcc6be118723851d08b27cd0e5c93bbc1b08d93fc (diff)
downloadbcm5719-llvm-b3d286776941aef765f8858d95f80808b528f2fa.tar.gz
bcm5719-llvm-b3d286776941aef765f8858d95f80808b528f2fa.zip
[mlir][spirv] Fix shader ABI attribute prefix and add verification
This commit fixes shader ABI attributes to use `spv.` as the prefix so that they match the dialect's namespace. This enables us to add verification hooks in the SPIR-V dialect to verify them. Reviewed By: mravishankar Differential Revision: https://reviews.llvm.org/D72062
Diffstat (limited to 'mlir/include')
-rw-r--r--mlir/include/mlir/Dialect/SPIRV/SPIRVDialect.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/mlir/include/mlir/Dialect/SPIRV/SPIRVDialect.h b/mlir/include/mlir/Dialect/SPIRV/SPIRVDialect.h
index 0c0eebd34d1..303895edea8 100644
--- a/mlir/include/mlir/Dialect/SPIRV/SPIRVDialect.h
+++ b/mlir/include/mlir/Dialect/SPIRV/SPIRVDialect.h
@@ -45,6 +45,23 @@ public:
/// Provides a hook for materializing a constant to this dialect.
Operation *materializeConstant(OpBuilder &builder, Attribute value, Type type,
Location loc) override;
+
+ /// Provides a hook for verifying SPIR-V dialect attributes attached to the
+ /// given op.
+ LogicalResult verifyOperationAttribute(Operation *op,
+ NamedAttribute attribute) override;
+
+ /// Provides a hook for verifying SPIR-V dialect attributes attached to the
+ /// given op's region argument.
+ LogicalResult verifyRegionArgAttribute(Operation *op, unsigned regionIndex,
+ unsigned argIndex,
+ NamedAttribute attribute) override;
+
+ /// Provides a hook for verifying SPIR-V dialect attributes attached to the
+ /// given op's region result.
+ LogicalResult verifyRegionResultAttribute(Operation *op, unsigned regionIndex,
+ unsigned resultIndex,
+ NamedAttribute attribute) override;
};
} // end namespace spirv
OpenPOWER on IntegriCloud