[MLIR] Add Linalg support for integer (generalized) matmuls
authorGeoffrey Martin-Noble <gcmn@google.com>
Thu, 18 Feb 2021 23:37:15 +0000 (15:37 -0800)
committerGeoffrey Martin-Noble <gcmn@google.com>
Mon, 22 Feb 2021 19:13:26 +0000 (11:13 -0800)
commit2ce6a42cc94dbe1b0456ebc34c0db238bf5530d6
tree0437c3786999014427b6c7b8c93d96cfb581395c
parented4d12c2ce30e5a1c270e2b4a08e67851ff8b295
[MLIR] Add Linalg support for integer (generalized) matmuls

This patch adds Linalg named ops for various types of integer matmuls.
Due to limitations in the tc spec/linalg-ods-gen ops cannot be type
polymorphic, so this instead creates new ops (improvements to the
methods for defining Linalg named ops are underway with a prototype at
https://github.com/stellaraccident/mlir-linalgpy).

To avoid the necessity of directly referencing these many new ops, this
adds additional methods to ContractionOpInterface to allow classifying
types of operations based on their indexing maps.

Reviewed By: nicolasvasilache, mravishankar

Differential Revision: https://reviews.llvm.org/D97006
mlir/include/mlir/Dialect/Linalg/IR/LinalgInterfaces.td
mlir/include/mlir/Dialect/Linalg/IR/LinalgNamedStructuredOpsSpec.tc