[mlir] Introduce Transform ops for loops
authorAlex Zinenko <zinenko@google.com>
Thu, 9 Jun 2022 09:10:32 +0000 (11:10 +0200)
committerAlex Zinenko <zinenko@google.com>
Thu, 9 Jun 2022 09:41:55 +0000 (11:41 +0200)
commit5f0d4f208e24a3e9f7369b712c5c2598dd5582d4
tree482a980daa17e739dbe74792c9f365943a2e241a
parentef4318e1a4ee7c9c1854d15b1343df73c2901f35
[mlir] Introduce Transform ops for loops

Introduce transform ops for "for" loops, in particular for peeling, software
pipelining and unrolling, along with a couple of "IR navigation" ops. These ops
are intended to be generalized to different kinds of loops when possible and
therefore use the "loop" prefix. They currently live in the SCF dialect as
there is no clear place to put transform ops that may span across several
dialects, this decision is postponed until the ops actually need to handle
non-SCF loops.

Additionally refactor some common utilities for transform ops into trait or
interface methods, and change the loop pipelining to be a returning pattern.

Reviewed By: springerm

Differential Revision: https://reviews.llvm.org/D127300
26 files changed:
mlir/include/mlir/Dialect/SCF/CMakeLists.txt
mlir/include/mlir/Dialect/SCF/Patterns.h [new file with mode: 0644]
mlir/include/mlir/Dialect/SCF/TransformOps/CMakeLists.txt [new file with mode: 0644]
mlir/include/mlir/Dialect/SCF/TransformOps/SCFTransformOps.h [new file with mode: 0644]
mlir/include/mlir/Dialect/SCF/TransformOps/SCFTransformOps.td [new file with mode: 0644]
mlir/include/mlir/Dialect/SCF/Transforms.h
mlir/include/mlir/Dialect/SCF/Utils/Utils.h
mlir/include/mlir/Dialect/Transform/IR/TransformInterfaces.h
mlir/include/mlir/Dialect/Transform/IR/TransformInterfaces.td
mlir/include/mlir/Dialect/Transform/IR/TransformOps.td
mlir/include/mlir/InitAllDialects.h
mlir/lib/Dialect/Linalg/TransformOps/LinalgTransformOps.cpp
mlir/lib/Dialect/SCF/CMakeLists.txt
mlir/lib/Dialect/SCF/TransformOps/CMakeLists.txt [new file with mode: 0644]
mlir/lib/Dialect/SCF/TransformOps/SCFTransformOps.cpp [new file with mode: 0644]
mlir/lib/Dialect/SCF/Transforms/LoopPipelining.cpp
mlir/lib/Dialect/SCF/Utils/Utils.cpp
mlir/lib/Dialect/Transform/IR/TransformOps.cpp
mlir/python/CMakeLists.txt
mlir/python/mlir/dialects/SCFLoopTransformOps.td [new file with mode: 0644]
mlir/python/mlir/dialects/_loop_transform_ops_ext.py [new file with mode: 0644]
mlir/python/mlir/dialects/transform/loop.py [new file with mode: 0644]
mlir/test/Dialect/SCF/transform-ops.mlir [new file with mode: 0644]
mlir/test/python/dialects/transform_loop_ext.py [new file with mode: 0644]
utils/bazel/llvm-project-overlay/mlir/BUILD.bazel
utils/bazel/llvm-project-overlay/mlir/python/BUILD.bazel