[mlir][Linalg] Mostly NFC - Refactor Linalg patterns and transformations.
authorNicolas Vasilache <ntv@google.com>
Sat, 2 May 2020 05:03:37 +0000 (01:03 -0400)
committerNicolas Vasilache <ntv@google.com>
Mon, 4 May 2020 15:17:37 +0000 (11:17 -0400)
commit307cfdf5338641e3a895857ef02dc9da35cd0eb6
treef0420cd80ce486ebbe0551f8c789469fa82904ac
parentc49f83b6e9e383ac9df02ab4d95974d7bb1e5ddc
[mlir][Linalg] Mostly NFC - Refactor Linalg patterns and transformations.

Linalg transformations are currently exposed as DRRs.
Unfortunately RewriterGen does not play well with the line of work on named linalg ops which require variadic operands and results.
Additionally, DRR is arguably not the right abstraction to expose compositions of such patterns that don't rely on SSA use-def semantics.

This revision abandons DRRs and exposes manually written C++ patterns.

Refactorings and cleanups are performed to uniformize APIs.
This refactoring will allow replacing the currently manually specified Linalg named ops.

A collateral victim of this refactoring is the `tileAndFuse` DRR, and the one associated test, which will be revived at a later time.

Lastly, the following 2 tests do not add value and are altered:
- a dot_perm tile + interchange test does not test anything new and is removed
- a dot tile + lower to loops does not need 2-D tiling and is trimmed.
19 files changed:
mlir/include/mlir/Dialect/Linalg/CMakeLists.txt
mlir/include/mlir/Dialect/Linalg/Transforms/CMakeLists.txt [deleted file]
mlir/include/mlir/Dialect/Linalg/Transforms/LinalgTransformPatterns.td [deleted file]
mlir/include/mlir/Dialect/Linalg/Transforms/LinalgTransforms.h [deleted file]
mlir/include/mlir/Dialect/Linalg/Transforms/Transforms.h [new file with mode: 0644]
mlir/include/mlir/Dialect/Linalg/Utils/Utils.h
mlir/lib/Dialect/Linalg/Transforms/CMakeLists.txt
mlir/lib/Dialect/Linalg/Transforms/Interchange.cpp [new file with mode: 0644]
mlir/lib/Dialect/Linalg/Transforms/LinalgTransforms.cpp [deleted file]
mlir/lib/Dialect/Linalg/Transforms/Loops.cpp [moved from mlir/lib/Dialect/Linalg/Transforms/LinalgToLoops.cpp with 93% similarity]
mlir/lib/Dialect/Linalg/Transforms/Promotion.cpp
mlir/lib/Dialect/Linalg/Transforms/Tiling.cpp
mlir/lib/Dialect/Linalg/Transforms/Transforms.cpp [new file with mode: 0644]
mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp [new file with mode: 0644]
mlir/test/Dialect/Linalg/transform-patterns.mlir
mlir/test/lib/DeclarativeTransforms/CMakeLists.txt
mlir/test/lib/DeclarativeTransforms/TestLinalgTransformPatterns.td [deleted file]
mlir/test/lib/Transforms/CMakeLists.txt
mlir/test/lib/Transforms/TestLinalgTransforms.cpp