Skip to content

Commit e611a4c

Browse files
authored
Revert "[mlir][amdgpu] Shared memory access optimization pass" (#78822)
Reverts #75627 ; it broke the bot: https://lab.llvm.org/buildbot/#/builders/61/builds/53218
1 parent ab0d8fc commit e611a4c

File tree

10 files changed

+1
-466
lines changed

10 files changed

+1
-466
lines changed

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

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -29,23 +29,6 @@ def AMDGPU_Dialect : Dialect {
2929
"gpu::GPUDialect"
3030
];
3131
let useDefaultAttributePrinterParser = 1;
32-
33-
let extraClassDeclaration = [{
34-
/// Return true if the given MemRefType has an integer address
35-
/// space that matches the ROCDL shared memory address space or
36-
/// is a gpu::AddressSpaceAttr attribute with value 'workgroup`.
37-
static bool hasSharedMemoryAddressSpace(MemRefType type);
38-
39-
/// Return true if the given Attribute has an integer address
40-
/// space that matches the ROCDL shared memory address space or
41-
/// is a gpu::AddressSpaceAttr attribute with value 'workgroup`.
42-
static bool isSharedMemoryAddressSpace(Attribute type);
43-
44-
/// Defines the MemRef memory space attribute numeric value that indicates
45-
/// a memref is located in shared memory. This should correspond to the
46-
/// value used in ROCDL.
47-
static constexpr unsigned kSharedMemoryAddressSpace = 3;
48-
}];
4932
}
5033

5134
//===----------------------------------------------------------------------===//

mlir/include/mlir/Dialect/AMDGPU/Transforms/Passes.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ namespace mlir {
2020
class ConversionTarget;
2121
namespace amdgpu {
2222

23-
#define GEN_PASS_DECL
24-
23+
#define GEN_PASS_DECL_AMDGPUEMULATEATOMICSPASS
2524
#define GEN_PASS_REGISTRATION
2625
#include "mlir/Dialect/AMDGPU/Transforms/Passes.h.inc"
2726

mlir/include/mlir/Dialect/AMDGPU/Transforms/Passes.td

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,4 @@ def AmdgpuEmulateAtomicsPass : Pass<"amdgpu-emulate-atomics"> {
3030
"Chipset that these operations will run on">];
3131
}
3232

33-
def OptimizeSharedMemory : Pass<"amdgpu-optimize-shared-memory"> {
34-
let summary = "Optimizes accesses to shared memory memrefs in order to reduce bank conflicts.";
35-
let description = [{
36-
This pass adds a transformation and pass to the AMDGPU dialect that
37-
attempts to optimize reads/writes from a memref representing GPU shared
38-
memory in order to avoid bank conflicts.
39-
}];
40-
41-
let dependentDialects = [
42-
"memref::MemRefDialect", "vector::VectorDialect"
43-
];
44-
}
45-
4633
#endif // MLIR_DIALECT_AMDGPU_TRANSFORMS_PASSES_TD_

mlir/include/mlir/Dialect/AMDGPU/Transforms/Transforms.h

Lines changed: 0 additions & 54 deletions
This file was deleted.

mlir/include/mlir/Dialect/AMDGPU/Transforms/Utils.h

Lines changed: 0 additions & 24 deletions
This file was deleted.

mlir/lib/Dialect/AMDGPU/IR/AMDGPUDialect.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -43,21 +43,6 @@ void AMDGPUDialect::initialize() {
4343
>();
4444
}
4545

46-
bool amdgpu::AMDGPUDialect::isSharedMemoryAddressSpace(Attribute memorySpace) {
47-
if (!memorySpace)
48-
return false;
49-
if (auto intAttr = llvm::dyn_cast<IntegerAttr>(memorySpace))
50-
return intAttr.getInt() == AMDGPUDialect::kSharedMemoryAddressSpace;
51-
if (auto gpuAttr = llvm::dyn_cast<gpu::AddressSpaceAttr>(memorySpace))
52-
return gpuAttr.getValue() == gpu::AddressSpace::Workgroup;
53-
return false;
54-
}
55-
56-
bool amdgpu::AMDGPUDialect::hasSharedMemoryAddressSpace(MemRefType type) {
57-
Attribute memorySpace = type.getMemorySpace();
58-
return isSharedMemoryAddressSpace(memorySpace);
59-
}
60-
6146
//===----------------------------------------------------------------------===//
6247
// 8-bit float ops
6348
//===----------------------------------------------------------------------===//

mlir/lib/Dialect/AMDGPU/Transforms/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
add_mlir_dialect_library(MLIRAMDGPUTransforms
22
EmulateAtomics.cpp
3-
OptimizeSharedMemory.cpp
4-
Utils.cpp
53

64
ADDITIONAL_HEADER_DIRS
75
{$MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/AMDGPU/Transforms

0 commit comments

Comments
 (0)