[all-commits] [llvm/llvm-project] 0fa20e: [mlir][Affine] Add helper functions to allow reord...

Nicolas Vasilache via All-commits all-commits at lists.llvm.org
Tue Mar 14 04:07:46 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0fa20ecafe0c3c7ffde413800eb4b1551b432273
      https://github.com/llvm/llvm-project/commit/0fa20ecafe0c3c7ffde413800eb4b1551b432273
  Author: Nicolas Vasilache <nicolas.vasilache at gmail.com>
  Date:   2023-03-14 (Tue, 14 Mar 2023)

  Changed paths:
    M mlir/include/mlir/Dialect/Affine/Passes.h
    A mlir/include/mlir/Dialect/Affine/Transforms/Transforms.h
    M mlir/lib/Dialect/Affine/Transforms/AffineExpandIndexOps.cpp
    M mlir/lib/Dialect/Affine/Transforms/CMakeLists.txt
    A mlir/lib/Dialect/Affine/Transforms/DecomposeAffineOps.cpp
    A mlir/test/Dialect/Affine/decompose-affine-ops.mlir
    M mlir/test/lib/Dialect/Affine/CMakeLists.txt
    A mlir/test/lib/Dialect/Affine/TestDecomposeAffineOps.cpp
    M mlir/tools/mlir-opt/mlir-opt.cpp

  Log Message:
  -----------
  [mlir][Affine] Add helper functions to allow reordering affine.apply operands and decompose the ops into smaller components

Care is taken to order operands from least hoistable to most hoistable and to process subexpressions in the same
order.

This allows exposing more oppportunities for licm, cse and strength reduction.

Such a step should typically be applied while we still have loops in the IR and just before lowering affine ops to arith.
This is because the affine.apply canonicalization currently tries to maximally compose chains of affine.apply operations
and could undo the effects of these decompositions.

Depends on: D145784

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




More information about the All-commits mailing list