[all-commits] [llvm/llvm-project] fe9d0a: [MLIR] Generalize affine fusion to work on `Block`...

Uday Bondhugula via All-commits all-commits at lists.llvm.org
Wed Dec 14 09:27:26 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fe9d0a47d55ff3c55d8caa03c55c2651985b2f0a
      https://github.com/llvm/llvm-project/commit/fe9d0a47d55ff3c55d8caa03c55c2651985b2f0a
  Author: Uday Bondhugula <uday at polymagelabs.com>
  Date:   2022-12-14 (Wed, 14 Dec 2022)

  Changed paths:
    M mlir/include/mlir/Dialect/Affine/Passes.h
    M mlir/include/mlir/Dialect/Affine/Passes.td
    M mlir/lib/Dialect/Affine/Transforms/LoopFusion.cpp
    M mlir/lib/Dialect/Affine/Utils/LoopFusionUtils.cpp
    M mlir/test/Transforms/loop-fusion-2.mlir
    M mlir/test/Transforms/loop-fusion-3.mlir
    M mlir/test/Transforms/loop-fusion-4.mlir
    M mlir/test/Transforms/loop-fusion.mlir

  Log Message:
  -----------
  [MLIR] Generalize affine fusion to work on `Block` instead of `FuncOp`

The affine fusion pass can actually work on the top-level of a `Block`
and doesn't require to be called on a `FuncOp`. Remove this restriction
and generalize the pass to work on any `Block`. This allows fusion to be
performed, for example, on multiple blocks of a FuncOp or any
region-holding op like an scf.while, scf.if or even at an inner depth of
an affine.for or affine.if op. This generalization has no effect on
existing functionality. No changes to the fusion logic or its
transformational power were needed.

Update fusion pass to be a generic operation pass (instead of FuncOp
pass) and remove references and assumptions on the parent being a
FuncOp.

Reviewed By: dcaballe

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




More information about the All-commits mailing list