Open hanhanW opened 1 month ago
@pashu123 can you help fix it? What we want here is converting a nop transpose op into a shape_cast op. You can add the pattern to https://github.com/llvm/llvm-project/blob/main/mlir/lib/Dialect/Vector/Transforms/LowerVectorTranspose.cpp file; please create a new method (e.g., populateTransposeFoldingPatterns
) because we want to use it in vector shape optimization but not transpose lowering.
(We can move it to vector.transpose canonicalization patterns if we find it useful. People have different opinions about the canonical form, so I suggest to put it to LowerVectorTranspose.cpp
).
Sounds good! Thanks for the info.
In the direct vectorization path, the unpack op is lowered to
transfer_read + transpose + shape_cast
after tiling. It produces the below snippet. Thetranspose + shape_cast
is a nop because