[all-commits] [llvm/llvm-project] 76ead9: [mlir][TilingInterface] Use `LoopLikeOpInterface` ...

MaheshRavishankar via All-commits all-commits at lists.llvm.org
Thu Jan 25 21:26:35 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 76ead96c1d06ee0d828238bce96d0107e650b5fa
      https://github.com/llvm/llvm-project/commit/76ead96c1d06ee0d828238bce96d0107e650b5fa
  Author: MaheshRavishankar <1663364+MaheshRavishankar at users.noreply.github.com>
  Date:   2024-01-25 (Thu, 25 Jan 2024)

  Changed paths:
    M flang/lib/Optimizer/Dialect/FIROps.cpp
    M mlir/include/mlir/Dialect/SCF/IR/SCFOps.td
    M mlir/include/mlir/Dialect/SCF/Transforms/TileUsingInterface.h
    M mlir/include/mlir/Interfaces/LoopLikeInterface.td
    M mlir/lib/Dialect/Affine/IR/AffineOps.cpp
    M mlir/lib/Dialect/Linalg/TransformOps/LinalgTransformOps.cpp
    M mlir/lib/Dialect/Linalg/Transforms/Tiling.cpp
    M mlir/lib/Dialect/SCF/IR/SCF.cpp
    M mlir/lib/Dialect/SCF/Transforms/TileUsingInterface.cpp
    M mlir/lib/Dialect/SCF/Utils/Utils.cpp
    M mlir/lib/Interfaces/LoopLikeInterface.cpp
    M mlir/lib/Transforms/Utils/LoopInvariantCodeMotionUtils.cpp
    M mlir/test/Dialect/Linalg/generalize-tensor-unpack-tile.mlir
    M mlir/test/Dialect/Linalg/tile-conv.mlir
    M mlir/test/Dialect/Linalg/tile-tensors.mlir
    M mlir/test/Dialect/Linalg/transform-op-hoist-pad-build-packing-loop-nest.mlir
    M mlir/test/Dialect/Linalg/transform-op-hoist-pad.mlir
    M mlir/test/Dialect/Linalg/transform-op-peel-and-vectorize.mlir
    M mlir/test/Dialect/Tensor/tiling.mlir
    A mlir/test/Interfaces/TilingInterface/tile-and-fuse-using-scfforall.mlir
    M mlir/test/Interfaces/TilingInterface/tile-fuse-and-yield-using-interface.mlir
    A mlir/test/Interfaces/TilingInterface/tile-fuse-and-yield-using-scfforall.mlir
    M mlir/test/Interfaces/TilingInterface/tile-pad-using-interface.mlir
    M mlir/test/Interfaces/TilingInterface/tile-using-interface.mlir
    M mlir/test/Interfaces/TilingInterface/tile-using-scfforall.mlir
    M mlir/test/lib/Interfaces/TilingInterface/TestTilingInterfaceTransformOps.cpp
    M mlir/test/lib/Interfaces/TilingInterface/TestTilingInterfaceTransformOps.td
    M utils/bazel/llvm-project-overlay/mlir/BUILD.bazel

  Log Message:
  -----------
  [mlir][TilingInterface] Use `LoopLikeOpInterface` in tiling using SCF to unify tiling with `scf.for` and `scf.forall`. (#77874)

Using `LoopLikeOpInterface` as the basis for the implementation unifies
all the tiling logic for both `scf.for` and `scf.forall`. The only
difference is the actual loop generation. This is a follow up to
https://github.com/llvm/llvm-project/pull/72178
Instead of many entry points for each loop type, the loop type is now
passed as part of the options passed to the tiling method.

This is a breaking change with the following changes

1) The `scf::tileUsingSCFForOp` is renamed to `scf::tileUsingSCF`
2) The `scf::tileUsingSCFForallOp` is deprecated. The same
   functionality is obtained by using `scf::tileUsingSCF` and setting
   the loop type in `scf::SCFTilingOptions` passed into this method to
   `scf::SCFTilingOptions::LoopType::ForallOp` (using the
   `setLoopType` method).
3) The `scf::tileConsumerAndFusedProducerGreedilyUsingSCFForOp` is
   renamed to `scf::tileConsumerAndFuseProducerUsingSCF`. The use of
   the `controlFn` in `scf::SCFTileAndFuseOptions` allows implementing
   any strategy with the default callback implemeting the greedy fusion.
4) The `scf::SCFTilingResult` and `scf::SCFTileAndFuseResult` now use
   `SmallVector<LoopLikeOpInterface>`.
5) To make `scf::ForallOp` implement the parts of
   `LoopLikeOpInterface` needed, the `getOutputBlockArguments()`
   method is replaced with `getRegionIterArgs()`

These changes now bring the tiling and fusion capabilities using
`scf.forall` on par with what was already supported by `scf.for`




More information about the All-commits mailing list