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

Krzysztof Drewniak llvmlistbot at llvm.org
Tue Dec 12 07:38:03 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;
----------------
krzysz00 wrote:

Yeah, but this is, I think, designed to not break in the case where the shared memory's already been converted.

_That_ being said, I'd argue for the value of `3` to be over in rocdl, and for his "is it shared memory" thing being a `GPUDialect` utility

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


More information about the Mlir-commits mailing list