Skip to content

Commit

Permalink
Revert "update mlir-aie (Xilinx#508)" (Xilinx#510)
Browse files Browse the repository at this point in the history
This reverts commit fbff5e3.
  • Loading branch information
fifield authored Mar 20, 2024
1 parent fbff5e3 commit a0d4a08
Show file tree
Hide file tree
Showing 10 changed files with 91 additions and 90 deletions.
15 changes: 8 additions & 7 deletions mlir/lib/Conversion/AIRLoweringPass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -870,17 +870,18 @@ class ScfIfOpConversion : public OpConversionPattern<scf::IfOp> {
auto newIf = rewriter.replaceOpWithNewOp<scf::IfOp>(
op, retTys, op.getCondition(), hasElseBlock);

IRMapping remap;
rewriter.setInsertionPointToStart(newIf.thenBlock());
for (auto &o : op.thenBlock()->getOperations())
rewriter.clone(o, remap);
auto &thenOps = op.thenBlock()->getOperations();
auto &newThenOps = newIf.thenBlock()->getOperations();
newThenOps.splice(newThenOps.begin(), thenOps, thenOps.begin(),
thenOps.end());

if (!hasElseBlock)
return success();

rewriter.setInsertionPointToStart(newIf.elseBlock());
for (auto &o : op.elseBlock()->getOperations())
rewriter.clone(o, remap);
auto &elseOps = op.elseBlock()->getOperations();
auto &newElseOps = newIf.elseBlock()->getOperations();
newElseOps.splice(newElseOps.begin(), elseOps, elseOps.begin(),
elseOps.end());

return success();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
// CHECK: %[[VAL_8:.*]] = aie.buffer(%[[VAL_1]]) {sym_name = {{.*}}} : memref<32x32xbf16, 2>

// CHECK: aie.mem(%[[VAL_2]]) {
// CHECK: aie.dma_start(S2MM, 0, ^bb1, ^bb2, repeat_count = 1)
// CHECK: aie.dma_start(S2MM, 0, ^bb1, ^bb2)
// CHECK: ^bb1:
// CHECK: aie.use_lock(%[[VAL_5]], AcquireGreaterEqual, 1)
// CHECK: aie.dma_bd(%[[VAL_7]] : memref<32x32xbf16, 2>, 0, 1024)
Expand All @@ -37,7 +37,7 @@
// CHECK: }

// CHECK: aie.mem(%[[VAL_1]]) {
// CHECK: aie.dma_start(MM2S, 0, ^bb1, ^bb2, repeat_count = 1)
// CHECK: aie.dma_start(MM2S, 0, ^bb1, ^bb2)
// CHECK: ^bb1:
// CHECK: aie.use_lock(%[[VAL_4]], AcquireGreaterEqual, 1)
// CHECK: aie.dma_bd(%[[VAL_8]] : memref<32x32xbf16, 2>, 0, 1024)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
// CHECK: %[[VAL_10:.*]] = aie.buffer(%[[VAL_1]]) {sym_name = {{.*}}} : memref<32x32xbf16, 2>

// CHECK: aie.mem(%[[VAL_1]]) {
// CHECK: aie.dma_start(S2MM, 0, ^bb1, ^bb3, repeat_count = 1)
// CHECK: aie.dma_start(S2MM, 0, ^bb1, ^bb3)
// CHECK: ^bb1:
// CHECK: aie.use_lock(%[[VAL_4]], AcquireGreaterEqual, 1)
// CHECK: aie.dma_bd(%[[VAL_9]] : memref<32x32xbf16, 2>, 0, 1024)
Expand All @@ -46,7 +46,7 @@
// CHECK: aie.flow(%[[VAL_0]], DMA : 0, %[[VAL_1]], DMA : 0)

// CHECK: aie.memtile_dma(%[[VAL_0]]) {
// CHECK: aie.dma_start(MM2S, 0, ^bb1, ^bb2, repeat_count = 1)
// CHECK: aie.dma_start(MM2S, 0, ^bb1, ^bb2)
// CHECK: ^bb1:
// CHECK: aie.use_lock(%[[VAL_3]], AcquireGreaterEqual, 1)
// CHECK: aie.dma_bd(%[[VAL_8]] : memref<32x32xbf16, 1>, 0, 1024)
Expand Down Expand Up @@ -113,7 +113,7 @@ func.func @multi_memcpys_over_time() {
// CHECK: %[[VAL_14:.*]] = aie.buffer(%[[VAL_1]]) {sym_name = {{.*}}} : memref<32x32xbf16, 2>

// CHECK: aie.mem(%[[VAL_2]]) {
// CHECK: aie.dma_start(S2MM, 0, ^bb1, ^bb3, repeat_count = 1)
// CHECK: aie.dma_start(S2MM, 0, ^bb1, ^bb3)
// CHECK: ^bb1:
// CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, 1)
// CHECK: aie.dma_bd(%[[VAL_11]] : memref<32x32xbf16, 2>, 0, 1024)
Expand All @@ -137,7 +137,7 @@ func.func @multi_memcpys_over_time() {
// CHECK: }

// CHECK: aie.mem(%[[VAL_1]]) {
// CHECK: aie.dma_start(MM2S, 0, ^bb1, ^bb3, repeat_count = 1)
// CHECK: aie.dma_start(MM2S, 0, ^bb1, ^bb3)
// CHECK: ^bb1:
// CHECK: aie.use_lock(%[[VAL_4]], AcquireGreaterEqual, 1)
// CHECK: aie.dma_bd(%[[VAL_13]] : memref<32x32xbf16, 2>, 0, 1024)
Expand Down Expand Up @@ -221,7 +221,7 @@ func.func @core_to_core_ping_pong() {
// CHECK: %[[VAL_14:.*]] = aie.buffer(%[[VAL_1]]) {sym_name = {{.*}}} : memref<32x32xbf16, 2>

// CHECK: aie.mem(%[[VAL_2]]) {
// CHECK: aie.dma_start(S2MM, 0, ^bb1, ^bb3, repeat_count = 1)
// CHECK: aie.dma_start(S2MM, 0, ^bb1, ^bb3)
// CHECK: ^bb1:
// CHECK: aie.use_lock(%[[VAL_7]], AcquireGreaterEqual, 1)
// CHECK: aie.dma_bd(%[[VAL_11]] : memref<32x32xbf16, 2>, 0, 1024)
Expand All @@ -245,7 +245,7 @@ func.func @core_to_core_ping_pong() {
// CHECK: }

// CHECK: aie.mem(%[[VAL_1]]) {
// CHECK: aie.dma_start(MM2S, 0, ^bb1, ^bb3, repeat_count = 1)
// CHECK: aie.dma_start(MM2S, 0, ^bb1, ^bb3)
// CHECK: ^bb1:
// CHECK: aie.use_lock(%[[VAL_4]], AcquireGreaterEqual, 1)
// CHECK: aie.dma_bd(%[[VAL_13]] : memref<32x32xbf16, 2>, 0, 1024)
Expand Down
28 changes: 14 additions & 14 deletions mlir/test/Conversion/AIRToAIE/air_shimcpy_to_aie.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// CHECK: %[[VAL_13:.*]] = aie.buffer(%[[VAL_12]]) {sym_name = {{.*}}} : memref<1024xi32, 2>

// CHECK: aie.mem(%[[VAL_12]]) {
// CHECK: aie.dma_start(S2MM, 0, ^bb1, ^bb2, repeat_count = 1)
// CHECK: aie.dma_start(S2MM, 0, ^bb1, ^bb2)
// CHECK: ^bb1:
// CHECK: aie.use_lock(%[[VAL_14]], Acquire, 0)
// CHECK: aie.dma_bd(%[[VAL_13]] : memref<1024xi32, 2>, 0, 1024)
Expand Down Expand Up @@ -60,7 +60,7 @@ func.func @func1(%arg0 : memref<1024xi32>, %arg1 : memref<1024xi32>) -> () {
// CHECK: %[[VAL_16:.*]] = aie.buffer(%[[VAL_12]]) {sym_name = {{.*}}} : memref<512xi32, 2>

// CHECK: aie.mem(%[[VAL_12]]) {
// CHECK: aie.dma_start(S2MM, 0, ^bb1, ^bb3, repeat_count = 1)
// CHECK: aie.dma_start(S2MM, 0, ^bb1, ^bb3)
// CHECK: ^bb1:
// CHECK: aie.use_lock(%[[VAL_14]], Acquire, 0)
// CHECK: aie.dma_bd(%[[VAL_13]] : memref<1024xi32, 2>, 0, 1024)
Expand All @@ -69,7 +69,7 @@ func.func @func1(%arg0 : memref<1024xi32>, %arg1 : memref<1024xi32>) -> () {
// CHECK: ^bb2:
// CHECK: aie.end
// CHECK: ^bb3:
// CHECK: aie.dma_start(S2MM, 1, ^bb4, ^bb2, repeat_count = 1)
// CHECK: aie.dma_start(S2MM, 1, ^bb4, ^bb2)
// CHECK: ^bb4:
// CHECK: aie.use_lock(%[[VAL_15]], Acquire, 0)
// CHECK: aie.dma_bd(%[[VAL_16]] : memref<512xi32, 2>, 0, 512)
Expand Down Expand Up @@ -119,7 +119,7 @@ func.func @func2(%arg0 : memref<1024xi32>, %arg1 : memref<1024xi32>) -> () {
// CHECK: %[[VAL_5:.*]] = aie.buffer(%[[VAL_1]]) {sym_name = {{.*}}} : memref<512xi32, 2>

// CHECK: aie.mem(%[[VAL_1]]) {
// CHECK: aie.dma_start(S2MM, 0, ^bb1, ^bb3, repeat_count = 1)
// CHECK: aie.dma_start(S2MM, 0, ^bb1, ^bb3)
// CHECK: ^bb1:
// CHECK: aie.use_lock(%[[VAL_2]], Acquire, 0)
// CHECK: aie.dma_bd(%[[VAL_4]] : memref<1024xi32, 2>, 0, 1024)
Expand All @@ -128,7 +128,7 @@ func.func @func2(%arg0 : memref<1024xi32>, %arg1 : memref<1024xi32>) -> () {
// CHECK: ^bb2:
// CHECK: aie.end
// CHECK: ^bb3:
// CHECK: aie.dma_start(MM2S, 0, ^bb4, ^bb2, repeat_count = 1)
// CHECK: aie.dma_start(MM2S, 0, ^bb4, ^bb2)
// CHECK: ^bb4:
// CHECK: aie.use_lock(%[[VAL_3]], Acquire, 1)
// CHECK: aie.dma_bd(%[[VAL_5]] : memref<512xi32, 2>, 0, 512)
Expand Down Expand Up @@ -181,7 +181,7 @@ func.func @func3(%arg0 : memref<1024xi32>, %arg1 : memref<1024xi32>) -> () {
// CHECK: %[[VAL_5:.*]] = aie.buffer(%[[VAL_1]]) {sym_name = {{.*}}} : memref<512xi32, 2>

// CHECK: aie.mem(%[[VAL_1]]) {
// CHECK: aie.dma_start(S2MM, 0, ^bb1, ^bb3, repeat_count = 1)
// CHECK: aie.dma_start(S2MM, 0, ^bb1, ^bb3)
// CHECK: ^bb1:
// CHECK: aie.use_lock(%[[VAL_3]], Acquire, 0)
// CHECK: aie.dma_bd(%[[VAL_4]] : memref<1024xi32, 2>, 0, 1024)
Expand All @@ -190,7 +190,7 @@ func.func @func3(%arg0 : memref<1024xi32>, %arg1 : memref<1024xi32>) -> () {
// CHECK: ^bb2:
// CHECK: aie.end
// CHECK: ^bb3:
// CHECK: aie.dma_start(S2MM, 1, ^bb4, ^bb2, repeat_count = 1)
// CHECK: aie.dma_start(S2MM, 1, ^bb4, ^bb2)
// CHECK: ^bb4:
// CHECK: aie.use_lock(%[[VAL_2]], Acquire, 0)
// CHECK: aie.dma_bd(%[[VAL_5]] : memref<512xi32, 2>, 0, 512)
Expand Down Expand Up @@ -244,7 +244,7 @@ func.func @func4(%arg0 : memref<1024xi32>, %arg1 : memref<1024xi32>) -> () {
// CHECK: %[[VAL_5:.*]] = aie.buffer(%[[VAL_1]]) {sym_name = {{.*}}} : memref<512xi32, 2>

// CHECK: aie.mem(%[[VAL_1]]) {
// CHECK: aie.dma_start(S2MM, 0, ^bb1, ^bb3, repeat_count = 1)
// CHECK: aie.dma_start(S2MM, 0, ^bb1, ^bb3)
// CHECK: ^bb1:
// CHECK: aie.use_lock(%[[VAL_3]], Acquire, 0)
// CHECK: aie.dma_bd(%[[VAL_4]] : memref<1024xi32, 2>, 0, 1024)
Expand All @@ -253,7 +253,7 @@ func.func @func4(%arg0 : memref<1024xi32>, %arg1 : memref<1024xi32>) -> () {
// CHECK: ^bb2:
// CHECK: aie.end
// CHECK: ^bb3:
// CHECK: aie.dma_start(S2MM, 1, ^bb4, ^bb2, repeat_count = 1)
// CHECK: aie.dma_start(S2MM, 1, ^bb4, ^bb2)
// CHECK: ^bb4:
// CHECK: aie.use_lock(%[[VAL_2]], Acquire, 0)
// CHECK: aie.dma_bd(%[[VAL_5]] : memref<512xi32, 2>, 0, 512)
Expand Down Expand Up @@ -398,7 +398,7 @@ func.func @func6(%arg0 : memref<1024xi32>, %arg1 : memref<1024xi32>) -> () {
// CHECK: %[[VAL_8:.*]] = aie.buffer(%[[VAL_0]]) {sym_name = {{.*}}} : memref<1024xi32, 2>

// CHECK: aie.mem(%[[VAL_0]]) {
// CHECK: aie.dma_start(S2MM, 0, ^bb1, ^bb6, repeat_count = 1)
// CHECK: aie.dma_start(S2MM, 0, ^bb1, ^bb6)
// CHECK: ^bb1:
// CHECK: aie.use_lock(%[[VAL_4]], Acquire, 0)
// CHECK: aie.dma_bd(%[[VAL_6]] : memref<1024xi32, 2>, 0, 1024)
Expand All @@ -407,7 +407,7 @@ func.func @func6(%arg0 : memref<1024xi32>, %arg1 : memref<1024xi32>) -> () {
// CHECK: ^bb2:
// CHECK: aie.end
// CHECK: ^bb3:
// CHECK: aie.dma_start(S2MM, 1, ^bb4, ^bb2, repeat_count = 1)
// CHECK: aie.dma_start(S2MM, 1, ^bb4, ^bb2)
// CHECK: ^bb4:
// CHECK: aie.use_lock(%[[VAL_3]], Acquire, 0)
// CHECK: aie.dma_bd(%[[VAL_7]] : memref<1024xi32, 2>, 0, 1024)
Expand All @@ -419,7 +419,7 @@ func.func @func6(%arg0 : memref<1024xi32>, %arg1 : memref<1024xi32>) -> () {
// CHECK: aie.use_lock(%[[VAL_2]], Release, 1)
// CHECK: aie.next_bd ^bb4
// CHECK: ^bb6:
// CHECK: aie.dma_start(MM2S, 0, ^bb7, ^bb3, repeat_count = 1)
// CHECK: aie.dma_start(MM2S, 0, ^bb7, ^bb3)
// CHECK: ^bb7:
// CHECK: aie.use_lock(%[[VAL_5]], Acquire, 1)
// CHECK: aie.dma_bd(%[[VAL_6]] : memref<1024xi32, 2>, 0, 1024)
Expand Down Expand Up @@ -515,7 +515,7 @@ func.func @func7(%arg0 : memref<1024xi32>, %arg1 : memref<1024xi32>, %arg2 : mem
// CHECK: %[[VAL_5:.*]] = aie.buffer(%[[VAL_0]]) {sym_name = {{.*}}} : memref<16x8xi32, 2>

// CHECK: aie.mem(%[[VAL_0]]) {
// CHECK: aie.dma_start(S2MM, 0, ^bb1, ^bb3, repeat_count = 1)
// CHECK: aie.dma_start(S2MM, 0, ^bb1, ^bb3)
// CHECK: ^bb1:
// CHECK: aie.use_lock(%[[VAL_2]], Acquire, 0)
// CHECK: aie.dma_bd(%[[VAL_4]] : memref<16x8xi32, 2>, 0, 128)
Expand All @@ -524,7 +524,7 @@ func.func @func7(%arg0 : memref<1024xi32>, %arg1 : memref<1024xi32>, %arg2 : mem
// CHECK: ^bb2:
// CHECK: aie.end
// CHECK: ^bb3:
// CHECK: aie.dma_start(MM2S, 0, ^bb4, ^bb2, repeat_count = 1)
// CHECK: aie.dma_start(MM2S, 0, ^bb4, ^bb2)
// CHECK: ^bb4:
// CHECK: aie.use_lock(%[[VAL_3]], Acquire, 1)
// CHECK: aie.dma_bd(%[[VAL_5]] : memref<16x8xi32, 2>, 0, 128)
Expand Down
Loading

0 comments on commit a0d4a08

Please sign in to comment.