iree
iree copied to clipboard
[compiler][flow] Move cast, reshape and bitcast after transfer op
We got incoming IR of the form
%cast = tensor.cast %0 : tensor<2xf32> to tensor<?xf32>
%2 = flow.tensor.transfer %cast : tensor<?xf32>{%c2} to
#hal.device.affinity<@__device_0>
%cast_2 = tensor.cast %2 : tensor<?xf32> to tensor<2xf32>
We would like to allow for the 2 casts to get folded. We would also like to reduce the dynamism of the transfer op. To operate on a tensor with fewer dynamic dimensions.