[Mlir-commits] [mlir] Fix crash when using when using --finalize-memref-to-llvm (PR #112433)
Christian Ulmann
llvmlistbot at llvm.org
Tue Oct 15 23:42:22 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.";
----------------
Dinistro wrote:
This error should ideally be emitted on the operation that holds the type. With this, you can also improve your test to check that this was emitted on the correct line.
https://github.com/llvm/llvm-project/pull/112433
More information about the Mlir-commits
mailing list