Xilinx / mlir-air

MIT License
76 stars 26 forks source link

`air.channel.put/get` ops are not able to lower through `air-to-aie` if memref is not produced directly by `memref.alloc` #707

Open erwei-xilinx opened 1 month ago

erwei-xilinx commented 1 month ago

Unlike air.dma_memcpy_nd which has air-copy-to-dma folding its src/dst side memref chain---consisting of memref.subview, memref.transpose, or memref.expand_shape---into its wrap-and-stride list, air.channel.put/get, if having src/dst side memref produced by any of those memref ops, will fail at air-to-aie. This is because air-to-aie assumes that any memref op chain at src/dst were already folded to wraps and strides prior to this point.

This won't affect code progressively compiled from memref.copy via air.dma_memcpy_nd; it shall affect user handwritten code.

erwei-xilinx commented 1 month ago

Currently being handled with a slightly more informative failure: https://github.com/Xilinx/mlir-air/pull/706

Might be possible to make this work with some canonicalizer to air.channel.put/get to handle this scenario.