This adds a lowering similar to the general shape_cast lowering, but
instead moves elements a (scalable) subvector at a time via
vector.scalable.extract/insert. It is restricted to the case where both
the source and result vector types have a single trailing scalable
dimension (due to limitations of the insert/extract ops).
The current lowerings are now disabled for scalable vectors, as they
produce incorrect results at runtime (due to assuming a fixed number
of elements).
Examples of casts that now work:
// Flattening: %v = vector.shape_cast %arg0 : vector<4x[8]xi8> to vector<[32]xi8> // Un-flattening: %v = vector.shape_cast %arg0 : vector<[8]xi32> to vector<2x1x[4]xi32>
This comment is a bit unclear to me. How about:
? Not that I suggest that we start generating code like this, but this pattern could in principle support this, right? It does not because it relies on vector.scalable.{insert|extract}, but that could be relaxed in the future, right?