Skip to content

Commit e022322

Browse files
committed
Only use dynamic indices in make_dma_base
1 parent 445f96e commit e022322

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

mlir/include/mlir/Dialect/AMDGPU/IR/AMDGPU.td

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1232,10 +1232,8 @@ def AMDGPU_MakeDmaBaseOp :
12321232
Arguments<(ins
12331233
Arg<AnyMemRef, "buffer to read from">:$src,
12341234
Variadic<Index>:$src_indices,
1235-
OptionalAttr<DenseI64ArrayAttr>: $src_indices_const,
12361235
Arg<AnyMemRef, "buffer to write to">:$dst,
1237-
Variadic<Index>:$dst_indices,
1238-
OptionalAttr<DenseI64ArrayAttr>: $dst_indices_const)>,
1236+
Variadic<Index>:$dst_indices)>,
12391237
Results<(outs AMDGPU_TDMBaseType: $base)> {
12401238

12411239
// TODO:
@@ -1279,10 +1277,8 @@ def AMDGPU_MakeDmaBaseOp :
12791277
These tensor DMA operations were introduced in gfx1250.
12801278
}];
12811279

1282-
// TODO: Define a custom printer, parser to avoid space between $src/%dst and indices.
12831280
let assemblyFormat = [{
1284-
$src custom<DynamicIndexList>($src_indices, $src_indices_const) `,`
1285-
$dst custom<DynamicIndexList>($dst_indices, $dst_indices_const) attr-dict `:` type($src) `,` type($dst) `->` type(results)
1281+
$src `[` $src_indices `]` `,` $dst `[` $dst_indices `]` attr-dict `:` type($src) `,` type($dst) `->` type(results)
12861282
}];
12871283
}
12881284

mlir/test/Dialect/AMDGPU/ops.mlir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -689,10 +689,10 @@ func.func @memory_counter_wait() {
689689
// CHECK-LABEL: func @make_dma_base
690690
// CHECK-SAME: (%[[IDX:.+]]: index, %[[MEM:.+]]: memref<8xi32>, %[[SMEM:.+]]: memref<8xi32, #gpu.address_space<workgroup>>)
691691
func.func @make_dma_base(%idx: index, %mem: memref<8xi32>, %smem: memref<8xi32, #gpu.address_space<workgroup>>) {
692-
// CHECK: amdgpu.make_dma_base %[[MEM]] [%[[IDX]]], %[[SMEM]] [%[[IDX]]] : memref<8xi32>, memref<8xi32, #gpu.address_space<workgroup>> -> !amdgpu.tdm_base<i32>
692+
// CHECK: amdgpu.make_dma_base %[[MEM]][%[[IDX]]], %[[SMEM]][%[[IDX]]] : memref<8xi32>, memref<8xi32, #gpu.address_space<workgroup>> -> !amdgpu.tdm_base<i32>
693693
amdgpu.make_dma_base %mem[%idx], %smem[%idx] : memref<8xi32>, memref<8xi32, #gpu.address_space<workgroup>> -> !amdgpu.tdm_base<i32>
694694

695-
// CHECK: amdgpu.make_dma_base %[[SMEM]] [%[[IDX]]], %[[MEM]] [%[[IDX]]] : memref<8xi32, #gpu.address_space<workgroup>>, memref<8xi32> -> !amdgpu.tdm_base<i32>
695+
// CHECK: amdgpu.make_dma_base %[[SMEM]][%[[IDX]]], %[[MEM]][%[[IDX]]] : memref<8xi32, #gpu.address_space<workgroup>>, memref<8xi32> -> !amdgpu.tdm_base<i32>
696696
amdgpu.make_dma_base %smem[%idx], %mem[%idx] : memref<8xi32, #gpu.address_space<workgroup>>, memref<8xi32> -> !amdgpu.tdm_base<i32>
697697
func.return
698698
}

0 commit comments

Comments
 (0)