[PATCH] D77067: [mlir][Linalg] Create a tool to generate named Linalg ops from a Tensor Comprehensions-like specification.

Nicolas Vasilache via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 30 20:46:05 PDT 2020


nicolasvasilache marked 2 inline comments as done.
nicolasvasilache added a comment.

@silvas I'd hope closer to "approaching production quality", it is missing comments though which will make it easier to read.
Note that almost everything above l. 1000 in mlir-linalg-ods-gen.cpp is borrowed from other places.
For some reason Token, Lexer and core Parser are kept hidden within MLIR  and I would very much like to expose them and avoid the copy-pasta (@rriddle what's your take on this?).



================
Comment at: mlir/test/mlir-linalg-ods-gen/test-linalg-ods-gen.tc:23
+//
+def matvec(A: f32(M, K), B: f32(K)) -> (C: f32(M)) {
+  C(m) = std_addf<k>(std_mulf(A(m, k), B(k)));
----------------
silvas wrote:
> This actually looks like it could be reasonably parsed with a custom `linalg_named_op_gen.def` op? Or is there a dependency issue with using MLIR for this as this needs to happen during build time?
This needs to generate ODS which in turn defines new ops.
I think what you are referring to would be the `linalg.generic` form which has verbosity issues as well as does not let you refer to `isa/cast/dyn_cast<MatmulOp>()`or let you matchAndRewrite easily.   


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D77067





More information about the llvm-commits mailing list