[PATCH] D80181: [mlir][spirv] Add remaining cooperative matrix instructions.

Thomas Raoux via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 27 18:02:24 PDT 2020


ThomasRaoux marked 3 inline comments as done.
ThomasRaoux added inline comments.


================
Comment at: mlir/lib/Dialect/SPIRV/SPIRVOps.cpp:2738
+  Type type;
+  if (parser.parseColonType(type)) {
+    return failure();
----------------
rriddle wrote:
> nit: Drop trivial braces.
I'll send a patch to address this.


================
Comment at: mlir/lib/Dialect/SPIRV/SPIRVOps.cpp:2746
+
+static void print(spirv::CooperativeMatrixLengthNVOp coopMatrix,
+                  OpAsmPrinter &printer) {
----------------
rriddle wrote:
> This looks like it should use the declarative format:
> 
> https://mlir.llvm.org/docs/OpDefinitions/#declarative-assembly-format
River, I wasn't able to get a syntax working for this instruction as the type itself is an argument and is unrelated to the destination. Do yo have any suggestion to make it work?


================
Comment at: mlir/lib/Dialect/SPIRV/SPIRVOps.cpp:2756
+static ParseResult parseCooperativeMatrixMulAddNVOp(OpAsmParser &parser,
+                                                    OperationState &state) {
+  SmallVector<OpAsmParser::OperandType, 3> ops;
----------------
rriddle wrote:
> Same here and a few others.
Here also I couldn't get the automatic print/parser to work as I have an instruction 
r = matmuladd a, b, c : type(a), type(b) -> type(r and c)
I wasn't able to express the fact that c and r must be the same type. Is there a way to make it work? 


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D80181/new/

https://reviews.llvm.org/D80181





More information about the llvm-commits mailing list