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

Siddhesh Deodhar llvmlistbot at llvm.org
Fri Nov 8 06:19:01 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() ||
----------------
siddhesh195 wrote:

Thank you for the reviews. If the PR looks good, can someone help merge because I don't have write access

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


More information about the Mlir-commits mailing list