Skip to content

Revert "[mlir][amdgpu] Shared memory access optimization pass" #78822

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions mlir/include/mlir/Dialect/AMDGPU/IR/AMDGPU.td
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,6 @@ def AMDGPU_Dialect : Dialect {
"gpu::GPUDialect"
];
let useDefaultAttributePrinterParser = 1;

let extraClassDeclaration = [{
/// Return true if the given MemRefType has an integer address
/// space that matches the ROCDL shared memory address space or
/// is a gpu::AddressSpaceAttr attribute with value 'workgroup`.
static bool hasSharedMemoryAddressSpace(MemRefType type);

/// Return true if the given Attribute has an integer address
/// space that matches the ROCDL shared memory address space or
/// is a gpu::AddressSpaceAttr attribute with value 'workgroup`.
static bool isSharedMemoryAddressSpace(Attribute type);

/// Defines the MemRef memory space attribute numeric value that indicates
/// a memref is located in shared memory. This should correspond to the
/// value used in ROCDL.
static constexpr unsigned kSharedMemoryAddressSpace = 3;
}];
}

//===----------------------------------------------------------------------===//
Expand Down
3 changes: 1 addition & 2 deletions mlir/include/mlir/Dialect/AMDGPU/Transforms/Passes.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ namespace mlir {
class ConversionTarget;
namespace amdgpu {

#define GEN_PASS_DECL

#define GEN_PASS_DECL_AMDGPUEMULATEATOMICSPASS
#define GEN_PASS_REGISTRATION
#include "mlir/Dialect/AMDGPU/Transforms/Passes.h.inc"

Expand Down
13 changes: 0 additions & 13 deletions mlir/include/mlir/Dialect/AMDGPU/Transforms/Passes.td
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,4 @@ def AmdgpuEmulateAtomicsPass : Pass<"amdgpu-emulate-atomics"> {
"Chipset that these operations will run on">];
}

def OptimizeSharedMemory : Pass<"amdgpu-optimize-shared-memory"> {
let summary = "Optimizes accesses to shared memory memrefs in order to reduce bank conflicts.";
let description = [{
This pass adds a transformation and pass to the AMDGPU dialect that
attempts to optimize reads/writes from a memref representing GPU shared
memory in order to avoid bank conflicts.
}];

let dependentDialects = [
"memref::MemRefDialect", "vector::VectorDialect"
];
}

#endif // MLIR_DIALECT_AMDGPU_TRANSFORMS_PASSES_TD_
54 changes: 0 additions & 54 deletions mlir/include/mlir/Dialect/AMDGPU/Transforms/Transforms.h

This file was deleted.

24 changes: 0 additions & 24 deletions mlir/include/mlir/Dialect/AMDGPU/Transforms/Utils.h

This file was deleted.

15 changes: 0 additions & 15 deletions mlir/lib/Dialect/AMDGPU/IR/AMDGPUDialect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,6 @@ void AMDGPUDialect::initialize() {
>();
}

bool amdgpu::AMDGPUDialect::isSharedMemoryAddressSpace(Attribute memorySpace) {
if (!memorySpace)
return false;
if (auto intAttr = llvm::dyn_cast<IntegerAttr>(memorySpace))
return intAttr.getInt() == AMDGPUDialect::kSharedMemoryAddressSpace;
if (auto gpuAttr = llvm::dyn_cast<gpu::AddressSpaceAttr>(memorySpace))
return gpuAttr.getValue() == gpu::AddressSpace::Workgroup;
return false;
}

bool amdgpu::AMDGPUDialect::hasSharedMemoryAddressSpace(MemRefType type) {
Attribute memorySpace = type.getMemorySpace();
return isSharedMemoryAddressSpace(memorySpace);
}

//===----------------------------------------------------------------------===//
// 8-bit float ops
//===----------------------------------------------------------------------===//
Expand Down
2 changes: 0 additions & 2 deletions mlir/lib/Dialect/AMDGPU/Transforms/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
add_mlir_dialect_library(MLIRAMDGPUTransforms
EmulateAtomics.cpp
OptimizeSharedMemory.cpp
Utils.cpp

ADDITIONAL_HEADER_DIRS
{$MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/AMDGPU/Transforms
Expand Down
Loading