[Mlir-commits] [mlir] [mlir][EmitC]Add a Reflection Map to a Class (PR #150572)
Marius Brehler
llvmlistbot at llvm.org
Mon Aug 4 08:10:23 PDT 2025
marbre wrote:
> > > [Apologies if I missed some earlier community discussion on this] This patch seems to be one in a series aimed at supporting specific MLGO features. Would be good if we could separate generic contributions that benefit most/all EmitC users (e.g. adding an `emit.class` op) from downstream-specific ones. For instance, the pass added here seems to perform a rather specific transformation and rely on existing dialect components. Could you elaborate on why it belongs upstream in MLIR core? If you believe these patterns (reflection map, func-to-class for AoT) to be beneficial for many EmitC users, would be great if you could post an RFC on the MLIR Discourse to facilitate a wider discussion in the community.
> > > + at marbre
> >
> >
> > Thanks @aniragil!
> > While there has been some discussion dating back to 2023 on what MLGO would need and resulting in the efforts by @simon-camp to add an upstream supported lowering to EmitC (PR #11754), it isn't clear to me what else is needed. Therefore, I would appreciate to discuss this based on an RFC as suggested by @aniragil.
>
> The RFC in question is [this one](https://discourse.llvm.org/t/tosa-reference-model-from-mlir-using-emitc/4799). The [MLGO usecase](https://discourse.llvm.org/t/tosa-reference-model-from-mlir-using-emitc/4799/13) was used as [one of the motivations](https://discourse.llvm.org/t/tosa-reference-model-from-mlir-using-emitc/4799/14), especially since MLGO is in-tree. The additional requirements (for MLGO) were [listed high-level](https://discourse.llvm.org/t/tosa-reference-model-from-mlir-using-emitc/4799/16), this patch here is for the "ability to bind by name" part.
>
> Perhaps we should make that relation to the RFC more clear in this patch description?
That RFC was specifically about upstreaming the TOSA to EmitC conversions and the reference implementation, both implemented in https://github.com/iml130/mlir-emitc/. It is correct that MLGO use-case was highlighted as a motivation but the specific RFC never got a lot of attraction and was never accepted. I think what Gil is asking for is a separate, more detailed RFC with regards to what is needed and what operations or conversions need to be implemented. It can of course refer to the linked thread and re-use arguments.
https://github.com/llvm/llvm-project/pull/150572
More information about the Mlir-commits
mailing list