[Mlir-commits] [mlir] [mlir][emitc] Add increment and decrement ops (PR #208648)

Gil Rapaport llvmlistbot at llvm.org
Tue Jul 28 01:06:09 PDT 2026


================
@@ -112,6 +112,10 @@ static FailureOr<int> getOperatorPrecedence(Operation *operation) {
       .Case([&](emitc::MemberOfPtrOp op) { return 17; })
       .Case([&](emitc::MemberOp op) { return 17; })
       .Case([&](emitc::MulOp op) { return 13; })
+      .Case([&](emitc::PostDecrementOp op) { return 16; })
+      .Case([&](emitc::PostIncrementOp op) { return 16; })
+      .Case([&](emitc::PreDecrementOp op) { return 15; })
+      .Case([&](emitc::PreIncrementOp op) { return 15; })
----------------
aniragil wrote:

Post ops should indeed have higher precedence than pre-ops. I was referring to their relative precedence compared to other operators: 17 seems to be the value given to the ones sharing their precedence (precedence 2 in your link) - subscript, member and member-of-pointer (not sure why function calls are placed at 16, but it seems the exception rather than the rule)

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


More information about the Mlir-commits mailing list