This operation was added five years ago and has no lowerings or uses within upstream MLIR. There’s only a handful of round-trip tests.
It seems the actual implementation has been left as a TODO:
// TODO: Add transformation which decomposes ReshapeOp into an optimized
// sequence of vector rotate/shuffle/select operations.
Is there any reason to keep an operation like this around? Are there downstream uses/implementations? or is this just an operation that was forgotten about?
Note: I don’t mind if it stays or goes, I’m just wondering why it is still here
As a related idea, sometime later vector.shape_cast could be renamed to vector.reshape, which could be a more accurate name (as shape_casts are not necessarily cast, they can lower to data movement).
I’d avoid too many renames in one go. Let this one sink, and if no downstream is affected, we talk about the next one.
Renaming is more complicated than removing an unused op. Unless of course, the renamed op is also unused. But I’d not cross wires as a general strategy.
I don’t intend to rename shape_cast with this change (or soon after it). It just occurred to me that if “vector.reshape” was free, it may be a more fitting name for what vector.shape_cast has evolved into.