[mlir] Add IteratorType enum to StructuredOpsUtils.
authorOleg Shyshkov <shyshkov@google.com>
Mon, 26 Sep 2022 10:33:08 +0000 (10:33 +0000)
committerOleg Shyshkov <shyshkov@google.com>
Mon, 26 Sep 2022 11:09:46 +0000 (11:09 +0000)
commit4f1c12425179608298dc39f5524ba2612609b5e4
tree94336b65ada7377a544dcc953d3e7bbf3fea3adc
parent0e912417c67db2dc32d32c98213dba42b9b607a6
[mlir] Add IteratorType enum to StructuredOpsUtils.

Summary:
Use the new enum in TilingIterface and verify that `iterator_type` attribute in
LinalgOp interface is compatible with the enum values. Later IteratorType enum
will be used in LinalgInterface to replace the current `iterator_type` attribute
array of string.

Existing enums in Linalg are moved into a separate td file and tablegen build
target. This is necessary, have one I32EnumAttr in a shared space that generated
enum class definition and EnumAttrs is dialect-specific location. Otherwise
there might be a conflict that I32EnumAttr generates enum definitions in
multiple places.

Differential Revision: https://reviews.llvm.org/D134634
14 files changed:
mlir/include/mlir/Dialect/CMakeLists.txt
mlir/include/mlir/Dialect/Linalg/IR/CMakeLists.txt
mlir/include/mlir/Dialect/Linalg/IR/LinalgBase.td
mlir/include/mlir/Dialect/Linalg/IR/LinalgEnums.td [new file with mode: 0644]
mlir/include/mlir/Dialect/Utils/CMakeLists.txt [new file with mode: 0644]
mlir/include/mlir/Dialect/Utils/StructuredOpsUtils.h
mlir/include/mlir/Dialect/Utils/StructuredOpsUtils.td [new file with mode: 0644]
mlir/include/mlir/Interfaces/TilingInterface.h
mlir/include/mlir/Interfaces/TilingInterface.td
mlir/lib/Dialect/Linalg/IR/LinalgInterfaces.cpp
mlir/lib/Dialect/Linalg/Transforms/TilingInterfaceImpl.cpp
mlir/lib/Dialect/Tensor/IR/TensorTilingInterfaceImpl.cpp
mlir/lib/Dialect/Utils/StructuredOpsUtils.cpp
utils/bazel/llvm-project-overlay/mlir/BUILD.bazel