[Mlir-commits] [mlir] [AMDGPU] add utils for common usage (PR #75097)

Quinn Dawkins llvmlistbot at llvm.org
Mon Dec 11 13:45:40 PST 2023


================
@@ -43,6 +43,21 @@ 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;
----------------
qedawkins wrote:

My understanding is that the convention is to keep the shared memory address space general for as long as possible, which to me seems like ROCDL would be the expected translation point. Can you elaborate on the reason to add an earlier dialect specific value for this?

(not necessarily a direct stakeholder here, mainly concerned about how magic memory space constants can be difficult to manage).

https://github.com/llvm/llvm-project/pull/75097


More information about the Mlir-commits mailing list