[Mlir-commits] [mlir] Handled UnrealizedConversionCast for C code generation and validated tests (PR #160159)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Thu Oct 9 21:46:38 PDT 2025


LekkalaSravya3 wrote:

Thank you for the detailed suggestion @simon-camp , @aniragil 

>From my understanding, I should modify the conversion to directly lower the input memref type to the !emitc.ptr<!emitc.array<...>> format and handle conversions using emitc::ApplyOp, ensuring that emitc::SubscriptOp supports the necessary index handling.

I just wanted to clarify one point — for cases like:

`builtin.unrealized_conversion_cast %arg0 : !emitc.size_t to index`

Would it make sense to handle the !emitc.size_t ↔ index conversion in a similar way within the TypeConverter? Specifically, by mapping index directly to !emitc.size_t and handling it uniformly during lowering, so we can avoid introducing UnrealizedConversionCastOp for these cases?

Would that approach be consistent with your suggestion?

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


More information about the Mlir-commits mailing list