[all-commits] [llvm/llvm-project] c10995: Re-apply [NFC] Generalize a couple of passes so th...

Stella Laurenzo via All-commits all-commits at lists.llvm.org
Mon Dec 13 13:33:30 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c10995a8adcec00cc929d9fa742758a415316fb2
      https://github.com/llvm/llvm-project/commit/c10995a8adcec00cc929d9fa742758a415316fb2
  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:
  -----------
  Re-apply [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 implicit nesting.
  * The Detensorize pass must run on a FunctionLike, and this requires explicit nesting.
* Addressed missed comments from the original and per-suggestion removed the assert on FunctionLike in ElementwiseToLinalg and DropUnitDims.cpp, which also is what was causing the integration test to fail.

This reverts commit aa8815e42e646a98663af4cf036dbb913ad047a7.

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




More information about the All-commits mailing list