[Mlir-commits] [mlir] [mlir][linalg] Check the strides and the dropped dims before vectorizing insert_slice (PR #221293)

Dhairyashil R G llvmlistbot at llvm.org
Sun Oct 4 10:20:15 PDT 2026


dhairyashilRG wrote:

@Tim096, sorry again for the overlap with #226490. To help get this one in, I applied your patch on top of #226490. Every hunk applies except the one that rewords the FIXME in `vectorizeAsInsertSliceOp`; that FIXME is no longer in the file.

- The stride check is still needed. With #226490 alone, the stride-3 insert from your description still lands in rows 0 and 1 instead of 0 and 3. With your `hasUnitStride()` check it is rejected. A dynamic stride is rejected too; it may be worth a test.
- The dropped-dims check has to go. With it, four rank-reducing tests in `insert-slice.mlir` fail, because it rejects inserts that #226490 vectorizes with a permutation map. Without it, `@insert_slice_rank_reducing_non_minor_dim` no longer produces its expected error, so that test can go as well.
- `@insert_slice_rank_reducing_leading_dim` passes either way.

So after a rebase this could be just the stride check and its test. I'm happy to review it, or to help with the rebase if that's useful. Could you also add "Part of #227821" to the description? That's where this work is tracked.

https://github.com/llvm/llvm-project/pull/221293


More information about the Mlir-commits mailing list