[Mlir-commits] [mlir] [mlir][vector] Missing indices on vectorization of 1-d reduction to 1-ranked memref (PR #166959)
Andrzej WarzyĆski
llvmlistbot at llvm.org
Thu Nov 13 09:30:46 PST 2025
banach-space wrote:
Thanks for the fix!
> Vectorization of a 1-d reduction where the output variable is a 1-ranked memref can generate an invalid `vector.transfer_write` with no indices for the memref, e.g.:
>
> vector.transfer_write"(%vec, %buff) <{...}> : (vector, memref<1xf32>) -> ()
>
> This patch solves the problem by providing the expected amount of indices (i.e. matching the rank of the memref).
Note, this problem is not really specific to memrefs, but rather to rank-1 shaped-types. I also suspect that we could find a repro for this that would not involve reductions.
The fix makes sense to me, but I have a few asks:
* Replace references to memrefs in the summary with references to rank-1 shaped-types, i.e. the actual root cause.
* There's no need to use memrefs in tests, is there? I suggest using tensors consistently.
* Update test function names, i.e. `%reduce_1d` -> `%reduce_to_rank_0`, `%reduce_1d_memref` -> `%reduce_to_rank_1` (or `%reduce_to_rank_1_memref` if you want to keep memrefs).
Thanks again and please send fixes if you identify more issues :)
https://github.com/llvm/llvm-project/pull/166959
More information about the Mlir-commits
mailing list