Thanks for the proposition, I have several questions regarding the semantics:
- Does this operation imply only cast semantics, i.e. the underlying data is never copied/moved?
- In any case, the specification needs a more precise description of the supported cases. Can it cast
memref<4x2xf32>tomemref<2x4xf32>? tomemref<8xf32>? tomemref<16xf32>, tomemref<64xi8>? Can it castmemref<*xf32>to any other memref rank than 1 or the rank of the underlying memref? - What is the behavior when the types don’t match dynamically, regardless of what “match” means?
- Can this be used to replace linalg.reshape?
- How does it work for strided memrefs?
Independently, I don’t think I understand the issue with variadic arguments. It looks like only the source or the target memref can be unranked. Therefore, the number of sizes seems always relatable to the rank of the other memref. Even if it wasn’t, we still can have a list of variadic arguments with dynamic length.