[all-commits] [llvm/llvm-project] 34696e: [NFC] Generalize a couple of passes so they can op...

Stella Laurenzo via All-commits all-commits at lists.llvm.org
Mon Dec 13 12:02:06 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 34696e6542894ac63dbfb899b0181c539c223ef1
      https://github.com/llvm/llvm-project/commit/34696e6542894ac63dbfb899b0181c539c223ef1
  Author: Stella Laurenzo <stellaraccident at gmail.com>
  Date:   2021-12-13 (Mon, 13 Dec 2021)

  Changed paths:
    M mlir/include/mlir/Dialect/Linalg/Passes.h
    M mlir/include/mlir/Dialect/Linalg/Passes.td
    M mlir/lib/Dialect/Linalg/Transforms/Detensorize.cpp
    M mlir/lib/Dialect/Linalg/Transforms/DropUnitDims.cpp
    M mlir/lib/Dialect/Linalg/Transforms/ElementwiseToLinalg.cpp
    M mlir/test/Dialect/Linalg/convert-elementwise-to-linalg.mlir
    M mlir/test/Dialect/Linalg/detensorize_0d.mlir
    M mlir/test/Dialect/Linalg/detensorize_br_operands.mlir
    M mlir/test/Dialect/Linalg/detensorize_if.mlir
    M mlir/test/Dialect/Linalg/detensorize_trivial.mlir
    M mlir/test/Dialect/Linalg/detensorize_while.mlir
    M mlir/test/Dialect/Linalg/detensorize_while_impure_cf.mlir
    M mlir/test/Dialect/Linalg/detensorize_while_pure_cf.mlir
    M mlir/test/Dialect/Linalg/drop-unit-extent-dims.mlir
    M mlir/test/Dialect/Linalg/fold-unit-trip-loops.mlir

  Log Message:
  -----------
  [NFC] Generalize a couple of passes so they can operate on any FunctionLike op.

* Generalizes passes linalg-detensorize, linalg-fold-unit-extent-dims, convert-elementwise-to-linalg.
* I feel that more work could be done in the future (i.e. make FunctionLike into a proper OpInterface and extend actions in dialect conversion to be trait based), and this patch would be a good record of why that is useful.
* Note for downstreams:
  * Since these passes are now generic, they do not automatically nest with pass managers set up for that.
  * If running them over nested functions, you must nest explicitly. Upstream has adopted this style but *-opt still has some uses of implicit pipelines via args. See tests for argument changes needed.

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




More information about the All-commits mailing list