- Rank-reducing subview is not supported yet
- Subview offsets must be statically known to be 0s and strides must 1s
They fold away subviews indiscriminately as soon as canonicalization is invoked.
This prematurely drops information that other parts of the compiler want to operate on.
Actually I think @mravishankar implemented similar functionality to fold subview away in the past, not sure whether they made it into core or just IREE?
Actually, there is a FoldSubViewOpsPass, but it can generate additional ops, which can be undesirable during canonicalization. Here I specifically restricted it in such way it never generates additional ops.
So, what useful information we are losing here? Subview dimensions? Is there any examples they can be usefull in this context?
The only example I can see is someone doing bounds-checked array accesses and doing this very late in pipeline (at memref->llvm lowering level), but this not very good idea in general IMO, regardless of this specific transformation.