[all-commits] [llvm/llvm-project] 0ac889: [mlir][Affine] Extend linearize/delinearize cancel...

Krzysztof Drewniak via All-commits all-commits at lists.llvm.org
Thu Nov 21 09:36:30 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0ac889b6b0bd467cf1ecbc26e80959badcdd5b55
      https://github.com/llvm/llvm-project/commit/0ac889b6b0bd467cf1ecbc26e80959badcdd5b55
  Author: Krzysztof Drewniak <Krzysztof.Drewniak at amd.com>
  Date:   2024-11-21 (Thu, 21 Nov 2024)

  Changed paths:
    M mlir/lib/Dialect/Affine/IR/AffineOps.cpp
    M mlir/test/Dialect/Affine/canonicalize.mlir

  Log Message:
  -----------
  [mlir][Affine] Extend linearize/delinearize cancelation to partial tails (#116872)

xisting patterns would cancel out the linearize_index /
delinearize_index pairs that had the exact same basis, like

    %0 = affine.linearize_index [%w, %x, %y, %z] by (X, Y, Z) : index
    %1:4 = affine.delinearize_index %0 into (W, X, Y, Z) : index, ...

This commit extends the canonicalization to handle instances where the
entire basis doesn't match, as in

    %0 = affine.linearize_index [%w, %x, %y, %z] by (X, Y, Z) : index
    %1:3 = affine.delinearize_index %0 into (XY, Y, Z) : index, ...

where we can replace the last two results of the delinearize_index
operation with the last two inputs of the linearize_index, creating a
more canonical (fewer total computations to perform) result.



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