[all-commits] [llvm/llvm-project] de9caf: [mlir][Interfaces] Add `promoteIfSingleIteration` ...

Matthias Springer via All-commits all-commits at lists.llvm.org
Mon Jul 3 09:04:06 PDT 2023

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: de9caf2f3244849cf0fe29bbf7cc67bae9035329
  Author: Matthias Springer <me at m-sp.org>
  Date:   2023-07-03 (Mon, 03 Jul 2023)

  Changed paths:
    M mlir/include/mlir/Dialect/SCF/IR/SCF.h
    M mlir/include/mlir/Dialect/SCF/IR/SCFOps.td
    M mlir/include/mlir/Dialect/SCF/Utils/Utils.h
    M mlir/include/mlir/Interfaces/LoopLikeInterface.h
    M mlir/include/mlir/Interfaces/LoopLikeInterface.td
    M mlir/lib/Dialect/SCF/IR/SCF.cpp
    M mlir/lib/Dialect/SCF/Utils/Utils.cpp
    M mlir/test/Dialect/SCF/one-shot-bufferize.mlir

  Log Message:
  [mlir][Interfaces] Add `promoteIfSingleIteration` to `LoopLikeOpInterface`

There are existing implementations for `scf.for`, `scf.forall` and `affine.for`. This revision adds an interface method to the `LoopLikeOpInterface`.

* `scf.forall` now implements the `LoopLikeOpInterface`.
* The implementations of `scf.for` and `scf.forall` become interface method implementations. `affine.for` remains as is for the moment. (The implementation of `promoteIfSingleIteration` depepends on helper functions from `MLIRAffineAnalysis`, which cannot be used from `MLIRAffineDialect`, where the interface is currently implemented.)
* More efficient implementations of `promoteIfSingleIteration`. In particular, the `scf.forall` operation now inlines operations instead of cloning them. This also preserves handles when used from the transform dialect.

Differential Revision: https://reviews.llvm.org/D154343

More information about the All-commits mailing list