Skip to content

Commit

Permalink
Disable lowering scf.for loop into repeat count, unless the dimension…
Browse files Browse the repository at this point in the history
… has non-zero offset (Xilinx#583)

* Disable repeat_count

* Disabling repeat count unless offset
  • Loading branch information
erwei-xilinx authored May 20, 2024
1 parent 0923c7d commit e844dc2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion mlir/lib/Conversion/AIRToAIESchedulingUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,8 @@ int air::getRepeatCount(Operation *memcpy_op) {
getConstantIntValue(chan_op.getSizes()[0])) {
auto const_highest_stride = getConstantIntValue(chan_op.getStrides()[0]);
auto const_highest_size = getConstantIntValue(chan_op.getSizes()[0]);
if (*const_highest_stride == 0) {
auto const_highest_offset = getConstantIntValue(chan_op.getOffsets()[0]);
if (*const_highest_stride == 0 && !const_highest_offset) {
// Highest dimension data access pattern is repeat.
return *const_highest_size;
}
Expand Down
8 changes: 4 additions & 4 deletions mlir/test/Conversion/AIRToAIE/air_shimcpy_to_aie2.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -640,15 +640,15 @@ func.func @func9(%arg0: memref<128xf32>, %arg1: memref<128xf32>) {
// Tile / memtile DMA repeat count support.
// CHECK: aie.device(xcve2802)
// CHECK: %[[tileDMA_0_4:.*]] = aie.mem
// CHECK: aie.dma_start(S2MM, 0, ^bb1, ^bb2, repeat_count = 32)
// CHECK: aie.dma_start(S2MM, 0, ^bb1, ^bb2, repeat_count = 1)
// CHECK: aie.dma_bd({{.*}} : memref<32x256xi32, 2>, 0, 8192)
// CHECK: %[[tileDMA_0_3:.*]] = aie.mem
// CHECK: aie.dma_start(S2MM, 0, ^bb1, ^bb2, repeat_count = 32)
// CHECK: aie.dma_start(S2MM, 0, ^bb1, ^bb2, repeat_count = 1)
// CHECK: aie.dma_bd({{.*}} : memref<32x256xi32, 2>, 0, 8192)
// CHECK: %[[memTileDMA_2_1:.*]] = aie.memtile_dma
// CHECK: aie.dma_start(MM2S, 0, ^bb1, ^bb3, repeat_count = 32)
// CHECK: aie.dma_start(MM2S, 0, ^bb1, ^bb3, repeat_count = 1)
// CHECK: aie.dma_bd({{.*}} : memref<32x256xi32, 1>, 0, 8192)
// CHECK: aie.dma_start(MM2S, 1, ^bb4, ^bb2, repeat_count = 32)
// CHECK: aie.dma_start(MM2S, 1, ^bb4, ^bb2, repeat_count = 1)
// CHECK: aie.dma_bd({{.*}} : memref<32x256xi32, 1>, 0, 8192)
// CHECK: @func10
#map = affine_map<()[s0] -> (s0 * 32)>
Expand Down

0 comments on commit e844dc2

Please sign in to comment.