[Mlir-commits] [mlir] 487a64a - [NVGPU] Fix crash on ui64 memory space attributes (#204580) (#204676)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Mon Jun 29 02:44:55 PDT 2026


Author: Naaz30
Date: 2026-06-29T11:44:51+02:00
New Revision: 487a64ad9271591e6e89a5dae35c54ee90bcc931

URL: https://github.com/llvm/llvm-project/commit/487a64ad9271591e6e89a5dae35c54ee90bcc931
DIFF: https://github.com/llvm/llvm-project/commit/487a64ad9271591e6e89a5dae35c54ee90bcc931.diff

LOG: [NVGPU] Fix crash on ui64 memory space attributes (#204580) (#204676)

Replaced getInt() with getValue() to fix crash on ui64 memory space
attributes.

---------

Co-authored-by: Naazni Yahya <naazniyahya at Naaznis-MacBook-Air.local>

Added: 
    

Modified: 
    mlir/lib/Dialect/NVGPU/IR/NVGPUDialect.cpp
    mlir/test/Dialect/NVGPU/optimize-shared-memory.mlir

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/NVGPU/IR/NVGPUDialect.cpp b/mlir/lib/Dialect/NVGPU/IR/NVGPUDialect.cpp
index 6e1ed05c9d0d0..2b2686a9163bf 100644
--- a/mlir/lib/Dialect/NVGPU/IR/NVGPUDialect.cpp
+++ b/mlir/lib/Dialect/NVGPU/IR/NVGPUDialect.cpp
@@ -50,7 +50,8 @@ bool NVGPUDialect::isSharedMemoryAddressSpace(Attribute memorySpace) {
   if (!memorySpace)
     return false;
   if (auto intAttr = llvm::dyn_cast<IntegerAttr>(memorySpace))
-    return intAttr.getInt() == NVGPUDialect::kSharedMemoryAddressSpace;
+    return intAttr.getValue().getZExtValue() ==
+           NVGPUDialect::kSharedMemoryAddressSpace;
   if (auto gpuAttr = llvm::dyn_cast<gpu::AddressSpaceAttr>(memorySpace))
     return gpuAttr.getValue() == gpu::AddressSpace::Workgroup;
   return false;

diff  --git a/mlir/test/Dialect/NVGPU/optimize-shared-memory.mlir b/mlir/test/Dialect/NVGPU/optimize-shared-memory.mlir
index 128c4c5d918d9..8c4381c2bcbf6 100644
--- a/mlir/test/Dialect/NVGPU/optimize-shared-memory.mlir
+++ b/mlir/test/Dialect/NVGPU/optimize-shared-memory.mlir
@@ -270,3 +270,15 @@ func.func @test_vector_element_type() {
   %alloc = memref.alloc() : memref<16x1xvector<16xf16>, 3>
   return
 }
+
+
+// -----
+
+
+// CHECK-LABEL: func @test_int_conversion
+module {
+  func.func @test_int_conversion() {
+    %alloc = memref.alloc() {alignment = 64 : i64} : memref<10xf32, 1 : ui64>
+    return
+  }
+}


        


More information about the Mlir-commits mailing list