Hi everyone,
I’ve been working with MLIR’s --convert-func-to-emitc
and --convert-memref-to-emitc
passes to translate MLIR functions to EmitC. However, I encountered an issue where these passes do not convert function parameters of type memref
to emitc
types. This lack of conversion causes the entire func
to remain incompatible with EmitC, preventing a successful translation into C++.
MLIR is a highly capable toolchain, so I was surprised to find that memref
parameter conversion is unsupported. Without the ability to handle memref
arguments, it seems that func
cannot be properly converted to EmitC for further translation into C++. This limitation is quite significant, as it hinders the completion of EmitC-based workflows that rely on memref
structures.
I’m also wondering if perhaps I misunderstood how this conversion should work. Is it possible that this issue could be handled at a higher abstraction level, rather than directly within func
?
To address this, I tried implementing a conversion that maps memref
types to emitc.array
during the func
to EmitC transformation. Would this approach be correct, or is there a better way to handle memref
conversions in EmitC?
Could someone provide guidance on:
- Why this functionality might be missing from the current MLIR toolchain?
- Whether mapping
memref
toemitc.array
is a feasible solution or if there are better alternatives within EmitC for handlingmemref
parameters.
Thank you!