[Mlir-commits] [mlir] [mlir][EmitC] Emit parentheses when expression ops are used as operands (PR #93691)
Gil Rapaport
llvmlistbot at llvm.org
Wed May 29 08:18:52 PDT 2024
aniragil wrote:
I wonder if we could instead add another restriction to `shouldBeInlined`: Don't inline if the user has the `CExpression` trait.
The rationale is that the using `CExpression` could have been fused into its operand `ExpressionOp`. If it wasn't, then the pass(es) that formed the expressions did not want it to be fused. Inlining the `ExpressionOp` operand into it goes against that intention.
This would also make sure that we handle expression emission in one place, i.e. `ExpressionOp`s, where `cast` should already be emitted correctly with parenthesis as needed.
https://github.com/llvm/llvm-project/pull/93691
More information about the Mlir-commits
mailing list