[Mlir-commits] [mlir] [mlir][vector] Add more patterns to Vector Linearize transformation (PR #136193)

James Newling llvmlistbot at llvm.org
Wed Apr 23 10:48:12 PDT 2025


newling wrote:

Hi @nbpatel I think these patterns will all useful for users of the vector dialect, but I have a few requests that I would like to make first:

1) while unrolling is a kind of linearization in spirit, there is what seems to be me a better place to add the patterns for load/store unrolling: https://github.com/llvm/llvm-project/blob/1b6cbaa7b64f54b127d139d653468e213bae007e/mlir/lib/Dialect/Vector/Transforms/VectorUnroll.cpp#L636 . I think if we keep the linearization patterns as strictly "shape_casts" -> "single op in rank 1" -> "shape_casts" it will be easier to understand the code base

2) Regarding the unrolling pattern here for insert_strided_slice, it's not clear why this isn't rather a conversion to shuffle (like extract_strided_slice is) in which case how is it different to https://github.com/llvm/llvm-project/blob/e1bb7f6ddec37567230d3e46719aee5bcd268d5a/mlir/lib/Dialect/Vector/Transforms/VectorInsertExtractStridedSliceRewritePatterns.cpp#L84 ? And if unrolling is required, I think it should migrate to the unrolling patterns. 

3) Please put the splat and create_mask patterns into separate PRs 

I know they're large requests, my apologies for not suggesting them earlier in the process. I think your contributions will be significantly more useful if done this way. 

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


More information about the Mlir-commits mailing list