[all-commits] [llvm/llvm-project] 8c05b5: [mlir][Affine] Cancel delinearize_index ops fully ...

Krzysztof Drewniak via All-commits all-commits at lists.llvm.org
Thu Oct 16 11:09:47 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8c05b5cca8784814cf11ac9d85c4ab59d2952ca5
      https://github.com/llvm/llvm-project/commit/8c05b5cca8784814cf11ac9d85c4ab59d2952ca5
  Author: Krzysztof Drewniak <Krzysztof.Drewniak at amd.com>
  Date:   2025-10-16 (Thu, 16 Oct 2025)

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

  Log Message:
  -----------
  [mlir][Affine] Cancel delinearize_index ops fully reversed by apply (#163440)

If an `affine.apply` uses every result of an
`affine.delinearize_index` operaration in an expresession of the form
x_0 * S_0 + x_1 * S_1 + ... + x_n * S_n + ..., where S_i is the "stride"
of the i-th delinerization result (the value it got divided by), then,
that chain of additions contains the inverse of the
affine.delinearize_index.

We don't want to compose affine.delinearize_index into affine.apply in
general, since this leads to "simplifications" (mainly the `x % y => x -
(x / y) * y` rewrite) thate are bad for code generation and algetbraic
reasoning. However, if we do see an exact inverse, we should cancel it
out.



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