[Mlir-commits] [mlir] [mlir][emitc] Mark emitc.literal with CExpression (PR #155582)

Marius Brehler llvmlistbot at llvm.org
Wed Aug 27 04:13:25 PDT 2025


================
@@ -98,6 +98,7 @@ static FailureOr<int> getOperatorPrecedence(Operation *operation) {
       .Case<emitc::ConditionalOp>([&](auto op) { return 2; })
       .Case<emitc::DivOp>([&](auto op) { return 13; })
       .Case<emitc::LoadOp>([&](auto op) { return 16; })
+      .Case<emitc::LiteralOp>([&](auto op) { return 16; })
----------------
marbre wrote:

LGTM technically but I am not sure if this is the correct precedence for the LiteralOp (see https://en.cppreference.com/w/cpp/language/operator_precedence.html and https://en.cppreference.com/w/c/language/operator_precedence.html).

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


More information about the Mlir-commits mailing list