[Mlir-commits] [mlir] [mlir][vector] Move transpose with unit-dim to shape_cast pattern (PR #72493)

Andrzej WarzyƄski llvmlistbot at llvm.org
Tue Nov 21 00:39:30 PST 2023


banach-space wrote:

I'm sorry that this is causing issues

> I'm also missing the context of why going down vector shape cast is preferrable. Can somebody explain or give me some pointers?

This is important in the context of scalable vectors:
* LLVM can handle arrays of scalable vectors (which means that `vector<1x[4]xf32>` is supported), however
* LLVM cannot deal with "scalable" arrays of vectors (which means that `vector<[4]x1xf32>` is not supported).

This canonicalisation merely flips the dimension to make things super easy further down the compilation stack (`vector<1x[4]xf32>` --> `vector<[4]x1xf32>`).

> Maybe we should make this be a separate pattern that is added where needed.

Would you be able to make a specific suggestion? What's available to make sure that a pattern doesn't trigger for a particular target?

Rather than reverting this, I'd much prefer for us to "move" or refactor this, so that it's no longer problematic. Currently this unblocking us and solving an issue for @dcaballe , so there are benefits of keeping this in tree.

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


More information about the Mlir-commits mailing list