[mlir][Vector] Fix scalable InsertSlice/ExtractSlice lowering (#124861)
commit2b04291830a2a34b681ae711dabfa1032f6c84f7
authorDiego Caballero <dieg0ca6aller0@gmail.com>
Fri, 31 Jan 2025 22:21:35 +0000 (31 14:21 -0800)
committerGitHub <noreply@github.com>
Fri, 31 Jan 2025 22:21:35 +0000 (31 14:21 -0800)
tree4036897e63019430bb7f09605b140f6ed98d063b
parent213a939a792f64e7bfdc684922abdf6cd1d3e388
[mlir][Vector] Fix scalable InsertSlice/ExtractSlice lowering (#124861)

It looks like scalable `vector.insertslice/extractslice` ops made their way
through lowering patterns that generate `vector.shuffle` ops. I'm not
sure why this wasn't caught by the verifier, probably because the
shuffle op was folded into something else as part of the same rewrite
and the IR wasn't verified.

This PR fixes the issue by preventing scalable vector.insertslice/extractslice
ops to be lowered to vector shuffles. Instead, they are now lowered to a
sequence of insertslice/extractelement ops using an existing patter.
mlir/lib/Dialect/Vector/Transforms/VectorInsertExtractStridedSliceRewritePatterns.cpp
mlir/test/Conversion/VectorToLLVM/vector-to-llvm.mlir