iree icon indicating copy to clipboard operation
iree copied to clipboard

[compiler][flow] Move cast, reshape and bitcast after transfer op

Open sogartar opened this issue 4 months ago • 3 comments

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.

sogartar avatar Oct 10 '24 12:10 sogartar