[Mlir-commits] [mlir] [MLIR][MemRefToLLVM] Fix crash in MemorySpaceCastOpLowering when type conversion fails (PR #186404)

Ivan Butygin llvmlistbot at llvm.org
Fri Mar 13 08:19:01 PDT 2026


================
@@ -1255,8 +1255,10 @@ struct MemorySpaceCastOpLowering
 
     Type resultType = op.getDest().getType();
     if (auto resultTypeR = dyn_cast<MemRefType>(resultType)) {
-      auto resultDescType =
-          cast<LLVM::LLVMStructType>(typeConverter->convertType(resultTypeR));
+      Type convertedType = typeConverter->convertType(resultTypeR);
----------------
Hardcode84 wrote:

I guess it will be more robust against the misconfigured type converter, but I'm fine either way.

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


More information about the Mlir-commits mailing list