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

Krzysztof Drewniak llvmlistbot at llvm.org
Fri Nov 8 09:57:54 PST 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() ||
----------------
krzysz00 wrote:

I'll run CI and land this, thanks for helping!

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


More information about the Mlir-commits mailing list