[all-commits] [llvm/llvm-project] 7ad564: [MLIR][MemRef] Fix LoadOpOfExpandShapeOpFolder ret...
Mehdi Amini via All-commits
all-commits at lists.llvm.org
Tue Mar 31 02:39:26 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 7ad564e54b42a921a70cd0d0f712dd86f61a697c
https://github.com/llvm/llvm-project/commit/7ad564e54b42a921a70cd0d0f712dd86f61a697c
Author: Mehdi Amini <joker.eph at gmail.com>
Date: 2026-03-31 (Tue, 31 Mar 2026)
Changed paths:
M mlir/lib/Dialect/MemRef/Transforms/FoldMemRefAliasOps.cpp
Log Message:
-----------
[MLIR][MemRef] Fix LoadOpOfExpandShapeOpFolder returning failure after IR change (#188964)
LoadOpOfExpandShapeOpFolder<vector::TransferReadOp>::matchAndRewrite
called resolveSourceIndicesExpandShape (which creates
AffineLinearizeIndexOp ops via the rewriter) before checking whether the
vector::TransferReadOp preconditions hold. When those checks failed
(sourceRank < vectorRank or permutation map mismatch), the pattern
returned failure() after already modifying the IR, triggering "pattern
returned failure but IR did change" under
MLIR_ENABLE_EXPENSIVE_PATTERN_API_CHECKS.
Fix by hoisting the vector::TransferReadOp precondition checks to before
the resolveSourceIndicesExpandShape call. The source rank is derived
from expandShapeOp.getViewSource()'s type (no IR creation needed), and
the permutation map check only uses op attributes. Only if all checks
pass do we proceed to create the linearized-index ops.
Assisted-by: Claude Code
Fix a failure present with MLIR_ENABLE_EXPENSIVE_PATTERN_API_CHECKS=ON.
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