[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:30:11 PDT 2024


================
@@ -106,8 +106,14 @@ bool ConvertToLLVMPattern::isConvertibleAndHasIdentityMaps(
 
 Type ConvertToLLVMPattern::getElementPtrType(MemRefType type) const {
   auto addressSpace = getTypeConverter()->getMemRefAddressSpace(type);
-  if (failed(addressSpace))
+  if (failed(addressSpace)) {
+    emitError(UnknownLoc::get(type.getContext()),
+              "conversion of memref memory space ")
+        << type.getMemorySpace()
+        << " to integer address space "
+           "failed. Consider adding memory space conversions.";
----------------
siddhesh195 wrote:

Thanks, made edits to emit the error on the operation

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


More information about the Mlir-commits mailing list