[Mlir-commits] [mlir] Fix crash when using when using --finalize-memref-to-llvm (PR #112433)

Siddhesh Deodhar llvmlistbot at llvm.org
Thu Oct 24 14:27:18 PDT 2024


================
@@ -527,8 +527,11 @@ LLVMTypeConverter::getMemRefAddressSpace(BaseMemRefType type) const {
     return failure();
   if (!(*converted)) // Conversion to default is 0.
     return 0;
-  if (auto explicitSpace = llvm::dyn_cast_if_present<IntegerAttr>(*converted))
-    return explicitSpace.getInt();
+  if (auto explicitSpace = dyn_cast_if_present<IntegerAttr>(*converted)) {
+    if (explicitSpace.getType().isIndex() ||
----------------
siddhesh195 wrote:

> Thanks, there currently is no separate attributes defined for signless and signed integer in BuiltinAttributes and IntegerAttr represents both signless and signed. [BuiltinAttributes](https://github.com/llvm/llvm-project/blob/4c8779388fd2f25730a1b044f9f10d6717833fce/mlir/include/mlir/IR/BuiltinAttributes.td#L657)

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


More information about the Mlir-commits mailing list