mlir-aie icon indicating copy to clipboard operation
mlir-aie copied to clipboard

-aie-standard-lowering doesn't handle AIE.wire

Open hanchenye opened this issue 3 years ago • 1 comments

Hi,

I'm playing with a test case like this:

  %0 = AIE.tile(1, 1)
  ... ...
  %266 = AIE.core(%0)  {
    ... ...
  }
  ... ...
  %339 = AIE.switchbox(%0)  {
    AIE.connect<DMA : 0, East : 0>
  }
  ... ...
  AIE.wire(%0 : Core, %339 : Core)
  AIE.wire(%0 : DMA, %339 : DMA)

When aiecc calls aie-opt --aie-standard-lowering=tilecol=1 tilerow=1 acdc_project/input_with_addresses.mlir -o acdc_project/core_1_1.mlir, the AIE.tile is erased while AIE.wires still using it. Error massage:

acdc_project/input_with_addresses.mlir:8:8: error: failed to legalize operation 'AIE.tile' marked as erased
  %0 = AIE.tile(1, 1)
       ^
acdc_project/input_with_addresses.mlir:8:8: note: see current operation: %0 = "AIE.tile"() {col = 1 : i32, row = 1 : i32} : () -> index
acdc_project/input_with_addresses.mlir:2409:3: note: found live user of result #0: AIE.wire(%0 : DMA, %300 : DMA)
  AIE.wire(%0 : DMA, %339 : DMA)

Did I miss anything, such as AIE.wire should be handled in an earlier stage of the pipeline?

Thanks, Hanchen

hanchenye avatar Oct 17 '21 02:10 hanchenye

I doubt you're missing anything. I've gone back and forth as to whether AIE.wire ops are useful or not. Currently they exist primarily for the --aie-find-flows pass, but we've discussed removing them entirely.

stephenneuendorffer avatar Oct 17 '21 02:10 stephenneuendorffer