[Mlir-commits] [mlir] [mlir][EmitC] Emit parentheses when expression ops are used as operands (PR #93691)

Corentin Ferry llvmlistbot at llvm.org
Mon Jun 3 23:43:13 PDT 2024


================
@@ -1338,8 +1343,9 @@ LogicalResult CppEmitter::emitOperand(Value value) {
   }
 
   auto expressionOp = dyn_cast_if_present<ExpressionOp>(value.getDefiningOp());
-  if (expressionOp && shouldBeInlined(expressionOp))
+  if (expressionOp && shouldBeInlined(expressionOp)) {
     return emitExpression(expressionOp);
+  }
----------------
cferry-AMD wrote:

```suggestion
  if (expressionOp && shouldBeInlined(expressionOp))
    return emitExpression(expressionOp);
```

https://github.com/llvm/llvm-project/pull/93691


More information about the Mlir-commits mailing list