[clang] [CIR][NFC] Update existing atomic ops to match assembly conventions (PR #161543)

Henrich Lauko via cfe-commits cfe-commits at lists.llvm.org
Sat Oct 4 03:54:17 PDT 2025


================
@@ -4245,20 +4244,17 @@ def CIR_AtomicCmpXchg : CIR_Op<"atomic.cmpxchg", [
                        UnitAttr:$is_volatile);
 
   let assemblyFormat = [{
-    `(`
-      $ptr `:` qualified(type($ptr)) `,`
-      $expected `:` type($expected) `,`
-      $desired `:` type($desired) `,`
-      `success` `=`  $succ_order `,`
-      `failure` `=`  $fail_order
-    `)`
-    (`align` `(` $alignment^ `)`)?
     (`weak` $weak^)?
+    custom<AtomicCmpXchgMemOrder>($succ_order, $fail_order)
+    $ptr `,` $expected `,` $desired
+    (`align` `(` $alignment^ `)`)?
     (`volatile` $is_volatile^)?
-    `:` `(` type($old) `,` type($success) `)` attr-dict
+    `:` `(`
+      qualified(type($ptr)) `,`
+      qualified(type($expected)) `,`
+      qualified(type($desired))
+    `)` `->` `(` type($old) `,` type($success) `)` attr-dict
----------------
xlauko wrote:

use functional-type here

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


More information about the cfe-commits mailing list