[Mlir-commits] [mlir] [mlir][emitc] Deferred emission as expressions (PR #159975)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Fri Apr 24 13:52:21 PDT 2026
================
@@ -1691,6 +1707,12 @@ LogicalResult CppEmitter::emitOperand(Value value, bool isInBrackets) {
if (expressionOp && shouldBeInlined(expressionOp))
return emitExpression(expressionOp);
+ if (auto cExpression =
+ dyn_cast_if_present<CExpressionInterface>(value.getDefiningOp())) {
+ if (cExpression.alwaysInline())
+ return emitExpression(value.getDefiningOp());
+ }
----------------
Jimmy2027 wrote:
```suggestion
if (Operation *def = value.getDefiningOp(); def && shouldBeInlined(def))
return emitExpression(def);
```
shouldBeInlined already encodes "alwaysInline CExpression or inlinable ExpressionOp"
https://github.com/llvm/llvm-project/pull/159975
More information about the Mlir-commits
mailing list