[Mlir-commits] [mlir] [mlir][vector] Relax constraints on shape_cast (PR #136587)
Diego Caballero
llvmlistbot at llvm.org
Fri May 9 16:36:21 PDT 2025
dcaballe wrote:
Sorry, I went on vacation before we could close on this discussion.
> I wasn’t even aware of the restrictions this is removing - and I suspect Diego wasn’t either, based on https://github.com/llvm/llvm-project/pull/135855#issuecomment-2809234621.
I had forgotten about this. The historical reasoning, IIRC, was that a "generic" shape_cast was valid iff it could be expressed as a pair of shape_casts doing N->1D and 1D->M. That's why we may find that shape_cast ops are sometimes generated in pairs.
For me, the key point is that a shape cast should be no-op... that is, a reshape or view op that does not require any "data movement". We have to make sure we are not accidentally enabling cases that do not fit into this category... and I guess after that verification, we should follow up with updating canonicalization patterns and places where we generate shape casts in pairs (I haven't looked... it could be that this only happened in downstreams)...
Hopefully that helps and, again, sorry for the delay :)
https://github.com/llvm/llvm-project/pull/136587
More information about the Mlir-commits
mailing list