[all-commits] [llvm/llvm-project] 541f33: [mlir][linalg] Prevent hoisting of transfer pairs ...

Andrzej Warzyński via All-commits all-commits at lists.llvm.org
Fri Jun 27 05:18:38 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 541f33e0751d60b33e75efe0cd436396f27b91ca
      https://github.com/llvm/llvm-project/commit/541f33e0751d60b33e75efe0cd436396f27b91ca
  Author: Andrzej Warzyński <andrzej.warzynski at arm.com>
  Date:   2025-06-27 (Fri, 27 Jun 2025)

  Changed paths:
    M mlir/lib/Dialect/Linalg/Transforms/Hoisting.cpp
    M mlir/test/Dialect/Linalg/hoisting.mlir

  Log Message:
  -----------
  [mlir][linalg] Prevent hoisting of transfer pairs in the presence of aliases (#145235)

This patch adds additional checks to the hoisting logic to prevent hoisting of
`vector.transfer_read` / `vector.transfer_write` pairs when the underlying
memref has users that introduce aliases via operations implementing
`ViewLikeOpInterface`.

Note: This may conservatively block some valid hoisting opportunities and could
affect performance. However, as demonstrated by the included tests, the current
logic is too permissive and can lead to incorrect transformations.

If this change prevents hoisting in cases that are provably safe, please share
a minimal repro - I'm happy to explore ways to relax the check.

Special treatment is given to `memref.assume_alignment`, mainly to accommodate
recent updates in:

* https://github.com/llvm/llvm-project/pull/139521

Note that such special casing does not scale and should generally be avoided.
The current hoisting logic lacks robust alias analysis. While better support
would require more work, the broader semantics of `memref.assume_alignment`
remain somewhat unclear. It's possible this op may eventually be replaced with
the "alignment" attribute added in:

* https://github.com/llvm/llvm-project/pull/144344



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