Skip to content

Commit 467af27

Browse files
authored
Revert "[mlir][amdgpu] Add common gpu mem space conversions to `conve… (#171594)
…rt-amdgpu-to-rocdl` (#171543)" This reverts commit fd0fb05. Forgot to link GPU lib and shared lib build failed.
1 parent 5a24dfa commit 467af27

File tree

2 files changed

+2
-53
lines changed

2 files changed

+2
-53
lines changed

mlir/lib/Conversion/AMDGPUToROCDL/AMDGPUToROCDL.cpp

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
#include "mlir/Conversion/AMDGPUToROCDL/AMDGPUToROCDL.h"
1010

11-
#include "mlir/Conversion/GPUCommon/GPUCommonPass.h"
1211
#include "mlir/Conversion/LLVMCommon/ConversionTarget.h"
1312
#include "mlir/Conversion/LLVMCommon/Pattern.h"
1413
#include "mlir/Conversion/LLVMCommon/TypeConverter.h"
@@ -2731,18 +2730,6 @@ struct ConvertAMDGPUToROCDLPass
27312730
});
27322731

27332732
populateAMDGPUToROCDLConversionPatterns(converter, patterns, *maybeChipset);
2734-
populateGpuMemorySpaceAttributeConversions(
2735-
converter, [](gpu::AddressSpace space) {
2736-
switch (space) {
2737-
case gpu::AddressSpace::Global:
2738-
return 1;
2739-
case gpu::AddressSpace::Workgroup:
2740-
return 3;
2741-
case gpu::AddressSpace::Private:
2742-
return 5;
2743-
}
2744-
llvm_unreachable("unknown address space enum value");
2745-
});
27462733
LLVMConversionTarget target(getContext());
27472734
target.addIllegalDialect<::mlir::amdgpu::AMDGPUDialect>();
27482735
target.addLegalDialect<::mlir::LLVM::LLVMDialect>();

mlir/test/Conversion/AMDGPUToROCDL/load_lds.mlir

Lines changed: 2 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// RUN: mlir-opt %s --convert-amdgpu-to-rocdl=chipset=gfx942 | FileCheck %s
2-
// RUN: mlir-opt %s --convert-amdgpu-to-rocdl=chipset=gfx950 | FileCheck %s
1+
// RUN: mlir-opt %s -convert-amdgpu-to-rocdl=chipset=gfx942 | FileCheck %s
2+
// RUN: mlir-opt %s -convert-amdgpu-to-rocdl=chipset=gfx950 | FileCheck %s
33

44
#gpu_global_addrspace = 1
55
#gpu_lds_addrspace = 3
@@ -43,44 +43,6 @@ func.func @global_load_to_rocdl_f32(%global : memref<128x72xf32, #gpu_global_add
4343
func.return
4444
}
4545

46-
// CHECK-LABEL: func @global_load_to_rocdl_wg_mem
47-
// CHECK-SAME: (%[[ARG0:.*]]: memref<128x72xf32>)
48-
func.func @global_load_to_rocdl_wg_mem(%global : memref<128x72xf32>) {
49-
%c0 = arith.constant 0 : index
50-
%c12 = arith.constant 12 : index
51-
%c32 = arith.constant 32 : index
52-
%alloc = memref.alloc() : memref<64x64xf32, #gpu.address_space<workgroup>>
53-
// CHECK: %[[GLOBAL_DESC:.*]] = builtin.unrealized_conversion_cast %[[ARG0]]
54-
55-
// CHECK: %[[C0:.*]] = arith.constant 0 : index
56-
// CHECK: %[[IC0:.*]] = builtin.unrealized_conversion_cast %c0 : index to i64
57-
// CHECK: %[[C12:.*]] = arith.constant 12 : index
58-
// CHECK: %[[IC12:.*]] = builtin.unrealized_conversion_cast %[[C12]]
59-
// CHECK: %[[C32:.*]] = arith.constant 32 : index
60-
// CHECK: %[[IC32:.*]] = builtin.unrealized_conversion_cast %[[C32]]
61-
62-
// CHECK: %[[ALLOC:.*]] = memref.alloc()
63-
// CHECK: %[[LDS_DESC:.*]] = builtin.unrealized_conversion_cast
64-
// CHECK: %[[GLOBAL_BASE:.*]] = llvm.extractvalue %[[GLOBAL_DESC]][1]
65-
66-
// CHECK: %[[C72:.*]] = llvm.mlir.constant(72 : index) : i64
67-
// CHECK: %[[MUL:.*]] = llvm.mul %[[IC12]], %[[C72]] : i64
68-
// CHECK: %[[SRC_OFFSET:.*]] = llvm.add %[[MUL]], %[[IC0]] : i64
69-
70-
// CHECK: %[[GLOBAL_PTR:.*]] = llvm.getelementptr %[[GLOBAL_BASE]][%[[SRC_OFFSET]]]
71-
// CHECK: %[[LDS_BASE:.*]] = llvm.extractvalue %[[LDS_DESC]][1]
72-
73-
// CHECK: %[[C64:.*]] = llvm.mlir.constant(64 : index) : i64
74-
// CHECK: %[[MUL_2:.*]] = llvm.mul %[[IC32]], %[[C64]] : i64
75-
// CHECK: %[[DST_OFFSET:.*]] = llvm.add %[[MUL_2]], %[[IC0]] : i64
76-
77-
// CHECK: %[[LDS_PTR:.*]] = llvm.getelementptr %[[LDS_BASE]][%[[DST_OFFSET]]]
78-
// CHECK: rocdl.load.to.lds %[[GLOBAL_PTR]], %[[LDS_PTR]], 4
79-
amdgpu.gather_to_lds %global[%c12, %c0], %alloc[%c32, %c0]
80-
: f32, memref<128x72xf32>, memref<64x64xf32, #gpu.address_space<workgroup>>
81-
func.return
82-
}
83-
8446
// CHECK-LABEL: func @global_load_to_rocdl_i8
8547
// CHECK-SAME: (%[[ARG0:.*]]: memref<128x72xi8, 1>)
8648
func.func @global_load_to_rocdl_i8(%global : memref<128x72xi8, #gpu_global_addrspace>) {

0 commit comments

Comments
 (0)