Skip to content

Commit 3d62b54

Browse files
committed
Switch lds and global
1 parent 0512303 commit 3d62b54

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1229,11 +1229,10 @@ def AMDGPU_ScaledMFMAOp :
12291229

12301230
def AMDGPU_MakeDmaBaseOp :
12311231
AMDGPU_Op<"make_dma_base", [Pure, AttrSizedOperandSegments]>,
1232-
Arguments<(ins
1232+
Arguments<(ins Arg<AnyMemRef>:$global,
1233+
Variadic<Index>:$global_indices,
12331234
Arg<AnyMemRef>:$lds,
1234-
Variadic<Index>:$lds_indices,
1235-
Arg<AnyMemRef>:$global,
1236-
Variadic<Index>:$global_indices)>,
1235+
Variadic<Index>:$lds_indices)>,
12371236
Results<(outs AMDGPU_TDMBaseType: $base)> {
12381237

12391238
// TODO:
@@ -1250,7 +1249,7 @@ def AMDGPU_MakeDmaBaseOp :
12501249
For example:
12511250

12521251
```mlir
1253-
%base = amdgpu.make_dma_base %lds[%idx0, %idx1], %global[%idx2, %idx3] : memref<64x64xi32, #gpu.address_space<workgroup>>, memref<64x64xi32> -> !amdgpu.tdm_base<i32>
1252+
%base = amdgpu.make_dma_base %global[%idx0, %idx1], %lds[%idx2, %idx3] : memref<64x64xi32>, memref<64x64xi32, #gpu.address_space<workgroup>> -> !amdgpu.tdm_base<i32>
12541253
%descriptor = amdgpu.make_dma_descriptor %base globalSize [2, 2] globalStride [2, 1] sharedSize [2, 2] : !amdgpu.tdm_base<i32> -> !amdgpu.tdm_descriptor
12551254
amdgpu.tensor_load_to_lds %descriptor : !amdgpu.tdm_descriptor
12561255
```
@@ -1279,7 +1278,7 @@ def AMDGPU_MakeDmaBaseOp :
12791278
}];
12801279

12811280
let assemblyFormat = [{
1282-
$lds `[` $lds_indices `]` `,` $global `[` $global_indices `]` attr-dict `:` type($lds) `,` type($global) `->` type(results)
1281+
$global `[` $global_indices `]` `,` $lds `[` $lds_indices `]` attr-dict `:` type($global) `,` type($lds) `->` type(results)
12831282
}];
12841283

12851284
let hasVerifier = 1;

mlir/test/Conversion/AMDGPUToROCDL/gfx1250.mlir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ func.func @make_dma_base(%idx: index, %mem: memref<8xi32, #gpu_global_addrspace>
206206
// CHECK: %[[V4I32_0_3:.+]] = llvm.insertelement %[[MEM_INT_LOW]], %[[V4I32_0_2]][%[[C2]] : i32]
207207
// CHECK: %[[V4I32_0_4:.+]] = llvm.insertelement %[[MEM_INT_HIGH_TYPE]], %[[V4I32_0_3]][%[[C3]] : i32]
208208

209-
%0 = amdgpu.make_dma_base %smem[%idx], %mem[%idx] : memref<8xi32, #gpu_lds_addrspace>, memref<8xi32, #gpu_global_addrspace> -> !amdgpu.tdm_base<i32>
209+
%0 = amdgpu.make_dma_base %mem[%idx], %smem[%idx] : memref<8xi32, #gpu_global_addrspace>, memref<8xi32, #gpu_lds_addrspace> -> !amdgpu.tdm_base<i32>
210210

211211
func.return %0 : !amdgpu.tdm_base<i32>
212212
}

mlir/test/Dialect/AMDGPU/ops.mlir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -689,8 +689,8 @@ 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 %[[SMEM]][%[[IDX]]], %[[MEM]][%[[IDX]]] : memref<8xi32, #gpu.address_space<workgroup>>, memref<8xi32> -> !amdgpu.tdm_base<i32>
693-
amdgpu.make_dma_base %smem[%idx], %mem[%idx] : memref<8xi32, #gpu.address_space<workgroup>>, memref<8xi32> -> !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>
693+
amdgpu.make_dma_base %mem[%idx], %smem[%idx] : memref<8xi32>, memref<8xi32, #gpu.address_space<workgroup>> -> !amdgpu.tdm_base<i32>
694694
func.return
695695
}
696696

0 commit comments

Comments
 (0)