[all-commits] [llvm/llvm-project] 49f90e: [mlir][affine] Cancel exactly-matching delinearize...

Krzysztof Drewniak via All-commits all-commits at lists.llvm.org
Tue Nov 12 13:36:30 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 49f90e798fe5667ac5e71a796aa897af3185137d
      https://github.com/llvm/llvm-project/commit/49f90e798fe5667ac5e71a796aa897af3185137d
  Author: Krzysztof Drewniak <Krzysztof.Drewniak at amd.com>
  Date:   2024-11-12 (Tue, 12 Nov 2024)

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

  Log Message:
  -----------
  [mlir][affine] Cancel exactly-matching delinearize/linearize pairs (#115758)

If we linearize values (with an assertion tha they are disjoint) and
then delinearize that linear index with th exact same basis, we know
that these operations are exact inverses of each other and can be
replaced with the original inputs to the linearization.

Similarly, if we take a linear index, delinearize it with some bases,
and then re-linearize it with that same basis (noting that the outputs
of the delinearization are guaranteed to by `disjoint`, even if this is
not asserted on the linearize_index operation), the re-linearization is
the inverse of the delinearization, so those two operations can also be
canceled out.

This commit adds canonicalization patterns for these simple
cancelations.



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