[all-commits] [llvm/llvm-project] cca321: [mlir][SCF] Use Affine ops for indexing math. (#10...

MaheshRavishankar via All-commits all-commits at lists.llvm.org
Fri Sep 27 18:26:03 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: cca32174fef004aadc177fcde44904e326c639fb
      https://github.com/llvm/llvm-project/commit/cca32174fef004aadc177fcde44904e326c639fb
  Author: MaheshRavishankar <1663364+MaheshRavishankar at users.noreply.github.com>
  Date:   2024-09-27 (Fri, 27 Sep 2024)

  Changed paths:
    M mlir/include/mlir/Dialect/Affine/IR/AffineOps.td
    M mlir/include/mlir/Dialect/Affine/Passes.td
    M mlir/include/mlir/Dialect/SCF/Transforms/Passes.td
    M mlir/lib/Dialect/Affine/IR/AffineOps.cpp
    M mlir/lib/Dialect/SCF/Transforms/ParallelLoopCollapsing.cpp
    M mlir/lib/Dialect/SCF/Utils/Utils.cpp
    M mlir/test/Dialect/Affine/canonicalize.mlir
    M mlir/test/Dialect/Affine/loop-coalescing.mlir
    M mlir/test/Dialect/SCF/transform-op-coalesce.mlir
    M mlir/test/Transforms/parallel-loop-collapsing.mlir
    M mlir/test/Transforms/single-parallel-loop-collapsing.mlir

  Log Message:
  -----------
  [mlir][SCF] Use Affine ops for indexing math. (#108450)

For index type of induction variable, the indexing math is better
represented using affine ops such as `affine.delinearize_index`.

This also further demonstrates that some of these `affine` ops might
need to move to a different dialect. For one these ops only support
`IndexType` when they should be able to work with any integer type.

This change also includes some canonicalization patterns for
`affine.delinearize_index` operation to
1) Drop unit `basis` values
2) Remove the `delinearize_index` op when the `linear_index` is a loop
induction variable of a normalized loop and the `basis` is of size 1 and
is also the upper bound of the normalized loop.

---------

Signed-off-by: MaheshRavishankar <mahesh.ravishankar at gmail.com>



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list