[PATCH] D80594: [MLIR][SPIRV] Adding new data type and decorators to SPIRV Dialect
Lei Zhang via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu May 28 15:25:36 PDT 2020
antiagainst accepted this revision.
antiagainst marked an inline comment as done.
antiagainst added a comment.
Awesome, thanks for the contribution!
================
Comment at: mlir/lib/Dialect/SPIRV/SPIRVDialect.cpp:208
+ if (auto t = type.dyn_cast<VectorType>()) {
+ if (t.getRank() != 1) {
+ parser.emitError(typeLoc, "only 1-D vector allowed but found ") << t;
----------------
Hazem wrote:
> antiagainst wrote:
> > I think we can use `CompositeType::isValid(t)` to check the vector rank and num elements.
> CompositeType::isValid(t) will return true for IntegerTypes as well, Matrix need to have Float types, unless you meant to use it then re-check that the vector elements are Float and not Integer in the parseAndVerifyMatrixType. Please let me know which one you had in mind. Thanks.
Actually both are fine. The current way makes sure we can have more meaningful error message, at the expense of duplicating the logic a bit. It's not too much duplication so it's fine. Thanks! :)
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D80594/new/
https://reviews.llvm.org/D80594
More information about the llvm-commits
mailing list