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

Quinn Dawkins llvmlistbot at llvm.org
Tue Dec 12 08:08:48 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:

+1 that's how I'm interpreting this as well. Using the `GPUDialect` utility for as long as possible seems consistent with other dialects and IMHO is more readable. It would be good to understand what cases we're hitting that has this early conversion of the shared memory space and whether this is the right level to handle it.

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


More information about the Mlir-commits mailing list