[Mlir-commits] [mlir] [mlir][emitc] Inline constant when translate (PR #143485)
Jianjian Guan
llvmlistbot at llvm.org
Thu Jun 12 00:05:08 PDT 2025
jacquesguan wrote:
> > Can this be moved from the Translation layer to a conversion pass? We have the Expression op which gets inlined under the right conditions. On top of that there ist already the FormExpressions pass, that does something like this. Maybe that can be reused/extended to have more control on which ops get turned into expressions. This would also have the advantage to make this feature opt in and not immediately break downstream Users.
>
> +1. Any reason why `emitc.constant` cannot be added the `CExpression` trait?
A constant op, such as `emitc.constant`, will be moved out to the parent region during applying patterns because of constant CSE. If we add `CExpression` to `emitc.constant`, In the FormExpressions pass, we will get an empty expression with only terminator yield.
https://github.com/llvm/llvm-project/pull/143485
More information about the Mlir-commits
mailing list