Skip to content

Commit 05dbd8b

Browse files
committed
Revert changes.
These changes are not needed anymore after lds and global memories position are specified in the operation. These functions were needed to find out which one was which during lowering before.
1 parent d3208e6 commit 05dbd8b

File tree

2 files changed

+30
-37
lines changed

2 files changed

+30
-37
lines changed

mlir/include/mlir/Dialect/AMDGPU/IR/AMDGPUDialect.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,6 @@ inline void printMNKDimensionList(OpAsmPrinter &printer, Operation *,
4848
IntegerAttr m, IntegerAttr n, IntegerAttr k) {
4949
printMNKDimensionList(printer, m, n, k);
5050
}
51-
52-
// Utility functions for quering the address space.
53-
bool hasGlobalMemorySpace(Attribute memorySpace);
54-
bool hasWorkgroupMemorySpace(Attribute memorySpace);
55-
bool hasFatRawBufferMemorySpace(Attribute memorySpace);
5651
} // namespace mlir::amdgpu
5752

5853
#define GET_ATTRDEF_CLASSES

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

Lines changed: 30 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -41,38 +41,6 @@ using namespace mlir::amdgpu;
4141

4242
#include "mlir/Dialect/AMDGPU/IR/AMDGPUDialect.cpp.inc"
4343

44-
namespace mlir::amdgpu {
45-
bool hasGlobalMemorySpace(Attribute memorySpace) {
46-
if (!memorySpace)
47-
return true;
48-
if (auto intMemorySpace = dyn_cast<IntegerAttr>(memorySpace))
49-
return intMemorySpace.getInt() == 0 || intMemorySpace.getInt() == 1;
50-
if (auto gpuMemorySpace = dyn_cast<gpu::AddressSpaceAttr>(memorySpace))
51-
return gpuMemorySpace.getValue() == gpu::AddressSpace::Global;
52-
return false;
53-
}
54-
55-
bool hasWorkgroupMemorySpace(Attribute memorySpace) {
56-
if (!memorySpace)
57-
return false;
58-
if (auto intMemorySpace = dyn_cast<IntegerAttr>(memorySpace))
59-
return intMemorySpace.getInt() == 3;
60-
if (auto gpuMemorySpace = dyn_cast<gpu::AddressSpaceAttr>(memorySpace))
61-
return gpuMemorySpace.getValue() == gpu::AddressSpace::Workgroup;
62-
return false;
63-
}
64-
65-
bool hasFatRawBufferMemorySpace(Attribute memorySpace) {
66-
if (!memorySpace)
67-
return false;
68-
if (auto intMemorySpace = dyn_cast<IntegerAttr>(memorySpace))
69-
return intMemorySpace.getInt() == 7;
70-
if (auto gpuMemorySpace = dyn_cast<amdgpu::AddressSpaceAttr>(memorySpace))
71-
return gpuMemorySpace.getValue() == amdgpu::AddressSpace::FatRawBuffer;
72-
return false;
73-
}
74-
} // namespace mlir::amdgpu
75-
7644
namespace {
7745
struct AMDGPUInlinerInterface final : DialectInlinerInterface {
7846
using DialectInlinerInterface::DialectInlinerInterface;
@@ -190,6 +158,36 @@ LogicalResult FatRawBufferCastOp::verify() {
190158
return success();
191159
}
192160

161+
static bool hasGlobalMemorySpace(Attribute memorySpace) {
162+
if (!memorySpace)
163+
return true;
164+
if (auto intMemorySpace = dyn_cast<IntegerAttr>(memorySpace))
165+
return intMemorySpace.getInt() == 0 || intMemorySpace.getInt() == 1;
166+
if (auto gpuMemorySpace = dyn_cast<gpu::AddressSpaceAttr>(memorySpace))
167+
return gpuMemorySpace.getValue() == gpu::AddressSpace::Global;
168+
return false;
169+
}
170+
171+
static bool hasWorkgroupMemorySpace(Attribute memorySpace) {
172+
if (!memorySpace)
173+
return false;
174+
if (auto intMemorySpace = dyn_cast<IntegerAttr>(memorySpace))
175+
return intMemorySpace.getInt() == 3;
176+
if (auto gpuMemorySpace = dyn_cast<gpu::AddressSpaceAttr>(memorySpace))
177+
return gpuMemorySpace.getValue() == gpu::AddressSpace::Workgroup;
178+
return false;
179+
}
180+
181+
static bool hasFatRawBufferMemorySpace(Attribute memorySpace) {
182+
if (!memorySpace)
183+
return false;
184+
if (auto intMemorySpace = dyn_cast<IntegerAttr>(memorySpace))
185+
return intMemorySpace.getInt() == 7;
186+
if (auto gpuMemorySpace = dyn_cast<amdgpu::AddressSpaceAttr>(memorySpace))
187+
return gpuMemorySpace.getValue() == amdgpu::AddressSpace::FatRawBuffer;
188+
return false;
189+
}
190+
193191
//===----------------------------------------------------------------------===//
194192
// RawBuffer*Op
195193
//===----------------------------------------------------------------------===//

0 commit comments

Comments
 (0)