Closed hanhanW closed 2 years ago
The input IR has the same redundancy:
%4 = hal.interface.binding.subspan set(0) binding(0) type(storage_buffer) : !flow.dispatch.tensor<readonly:?x?xi32>{%0, %1}
%6 = flow.dispatch.tensor.load %4, offsets = [0, 0], sizes = [%0, %1], strides = [1, 1] : !flow.dispatch.tensor<readonly:?x?xi32>{%0, %1} -> tensor<?x?xi32>
I would add a folding pattern for subview(subspan)
after bufferization. Does this sound reasonable?
Found some cases that redundant memref.subview ops are created in IREE.
Input:
Output:
%4
already carries the information that the dim sizes are%0, %1
. We don't need%8 = memref.subview ...
to get the whole memref again.