[mlir][TilingInterface] Add pattern to tile using TilingInterface and implement Tilin...
authorMahesh Ravishankar <ravishankarm@google.com>
Mon, 13 Jun 2022 19:56:32 +0000 (19:56 +0000)
committerMahesh Ravishankar <ravishankarm@google.com>
Mon, 13 Jun 2022 20:37:44 +0000 (20:37 +0000)
commitcf6a7c1947931df20cf294213c8edf2d8c0490f6
tree0c2b5775445a102fe25e8baca58a2eb34a02adce
parent602a951bfe3401f81e2759089b14a549c39dc394
[mlir][TilingInterface] Add pattern to tile using TilingInterface and implement TilingInterface for Linalg ops.

This patch adds support for tiling operations that implement the
TilingInterface.
- It separates the loop constructs that are used to iterate over tile
  from the implementation of the tiling itself. For example, the use
  of destructive updates is more related to use of scf.for for
  iterating over tiles that are tensors.
- To test the transformation, TilingInterface is implemented for
  LinalgOps. The separation of the looping constructs used from the
  implementation of tile code generation greatly simplifies the
  latter.
- The implementation of TilingInterface for LinalgOp is kept as an
  external model for now till this approach can be fully flushed out
  to replace the existing tiling + fusion approaches in Linalg.

Differential Revision: https://reviews.llvm.org/D127133
21 files changed:
mlir/include/mlir/Dialect/Linalg/Transforms/TilingInterfaceImpl.h [new file with mode: 0644]
mlir/include/mlir/Dialect/Linalg/Utils/Utils.h
mlir/include/mlir/Dialect/SCF/TileUsingInterface.h [new file with mode: 0644]
mlir/include/mlir/Dialect/SCF/Utils/Utils.h
mlir/include/mlir/Interfaces/TilingInterface.td
mlir/lib/Dialect/Linalg/Transforms/CMakeLists.txt
mlir/lib/Dialect/Linalg/Transforms/Tiling.cpp
mlir/lib/Dialect/Linalg/Transforms/TilingInterfaceImpl.cpp [new file with mode: 0644]
mlir/lib/Dialect/Linalg/Utils/Utils.cpp
mlir/lib/Dialect/SCF/Transforms/CMakeLists.txt
mlir/lib/Dialect/SCF/Transforms/TileUsingInterface.cpp [new file with mode: 0644]
mlir/lib/Dialect/SCF/Utils/Utils.cpp
mlir/test/Interfaces/TilingInterface/tile-using-interface.mlir [new file with mode: 0644]
mlir/test/lib/CMakeLists.txt
mlir/test/lib/Interfaces/CMakeLists.txt [new file with mode: 0644]
mlir/test/lib/Interfaces/TilingInterface/CMakeLists.txt [new file with mode: 0644]
mlir/test/lib/Interfaces/TilingInterface/TestTilingInterface.cpp [new file with mode: 0644]
mlir/tools/mlir-opt/CMakeLists.txt
mlir/tools/mlir-opt/mlir-opt.cpp
utils/bazel/llvm-project-overlay/mlir/BUILD.bazel
utils/bazel/llvm-project-overlay/mlir/test/BUILD.bazel