Skip to content

Commit e844dc2

Browse files
authored
Disable lowering scf.for loop into repeat count, unless the dimension has non-zero offset (Xilinx#583)
* Disable repeat_count * Disabling repeat count unless offset
1 parent 0923c7d commit e844dc2

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

mlir/lib/Conversion/AIRToAIESchedulingUtils.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,8 @@ int air::getRepeatCount(Operation *memcpy_op) {
186186
getConstantIntValue(chan_op.getSizes()[0])) {
187187
auto const_highest_stride = getConstantIntValue(chan_op.getStrides()[0]);
188188
auto const_highest_size = getConstantIntValue(chan_op.getSizes()[0]);
189-
if (*const_highest_stride == 0) {
189+
auto const_highest_offset = getConstantIntValue(chan_op.getOffsets()[0]);
190+
if (*const_highest_stride == 0 && !const_highest_offset) {
190191
// Highest dimension data access pattern is repeat.
191192
return *const_highest_size;
192193
}

mlir/test/Conversion/AIRToAIE/air_shimcpy_to_aie2.mlir

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -640,15 +640,15 @@ func.func @func9(%arg0: memref<128xf32>, %arg1: memref<128xf32>) {
640640
// Tile / memtile DMA repeat count support.
641641
// CHECK: aie.device(xcve2802)
642642
// CHECK: %[[tileDMA_0_4:.*]] = aie.mem
643-
// CHECK: aie.dma_start(S2MM, 0, ^bb1, ^bb2, repeat_count = 32)
643+
// CHECK: aie.dma_start(S2MM, 0, ^bb1, ^bb2, repeat_count = 1)
644644
// CHECK: aie.dma_bd({{.*}} : memref<32x256xi32, 2>, 0, 8192)
645645
// CHECK: %[[tileDMA_0_3:.*]] = aie.mem
646-
// CHECK: aie.dma_start(S2MM, 0, ^bb1, ^bb2, repeat_count = 32)
646+
// CHECK: aie.dma_start(S2MM, 0, ^bb1, ^bb2, repeat_count = 1)
647647
// CHECK: aie.dma_bd({{.*}} : memref<32x256xi32, 2>, 0, 8192)
648648
// CHECK: %[[memTileDMA_2_1:.*]] = aie.memtile_dma
649-
// CHECK: aie.dma_start(MM2S, 0, ^bb1, ^bb3, repeat_count = 32)
649+
// CHECK: aie.dma_start(MM2S, 0, ^bb1, ^bb3, repeat_count = 1)
650650
// CHECK: aie.dma_bd({{.*}} : memref<32x256xi32, 1>, 0, 8192)
651-
// CHECK: aie.dma_start(MM2S, 1, ^bb4, ^bb2, repeat_count = 32)
651+
// CHECK: aie.dma_start(MM2S, 1, ^bb4, ^bb2, repeat_count = 1)
652652
// CHECK: aie.dma_bd({{.*}} : memref<32x256xi32, 1>, 0, 8192)
653653
// CHECK: @func10
654654
#map = affine_map<()[s0] -> (s0 * 32)>

0 commit comments

Comments
 (0)