[Mlir-commits] [mlir] [mlir][EmitC] Add pass that combines all available emitc conversions (PR #117549)
Marius Brehler
llvmlistbot at llvm.org
Fri Feb 21 07:12:27 PST 2025
marbre wrote:
> I've also looked at the EmitC output for the TOSA model. While the TOSA to EmitC test seems to be able to generate C code after being passed through `mlir-translate`, I'm a bit confused as to why it has a custom pass-pipeline? I thought that when this patch introduced `--convert-to-emitc` the other bits in the custom pipeline would no longer be necessary. If that's the case, then would the next step after this patch be to create a specialized pipeline for TOSA->EmitC, so that users don't need to specify a custom pipeline?
I assume with _TOSA to EmitC_ you refer to what we provided with [iml130/mlir-emitc (Public archive
)](https://github.com/iml130/mlir-emitc)? While that was a 1:1 conversion, there is such direct conversion from TOSA to EmitC upstream. One would rather need to convert TOSA to _multiple_ upstream dialects. _Those dialects_ (scf, memref, ...) can be converted to EmitC afterwards and that allows to translate to C. What this patch introduces is to convert all supported dialects to EmitC, however, a user would need to translate from TOSA (or any other dialerct) to those first. This is done in the `mlir/test/Conversion/ConvertToEmitC/tosa.mlir` test but such a pipeline is always custom and I would say beyond what is implemented here.
https://github.com/llvm/llvm-project/pull/117549
More information about the Mlir-commits
mailing list