[clang] [llvm] [AArch64] Implement the atomic store with hint intrinsic (PR #198316)

via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 22 09:18:41 PDT 2026


================
@@ -282,6 +282,53 @@ def : Pat<(relaxed_store<atomic_store_64>
                (am_unscaled64 GPR64sp:$Rn, simm9:$offset), (i64 (bitconvert (f64 FPR64Op:$val)))),
           (STURDi FPR64Op:$val, GPR64sp:$Rn, simm9:$offset)>;
 
+//===----------------------------------
+// Atomic store with hint pseudos
+//===----------------------------------
+
+class BaseStoreHintPseudo<RegisterClass regtype>
+      : Pseudo<(outs), (ins GPR64sp:$addr, regtype:$data,
+                        i32imm:$order, i32imm:$hint), []>, Sched<[WriteAtomic]> {
+  let Size = 8;
+  let isCodeGenOnly = 1;
+  let hasSideEffects = 1;
+  let mayStore = 1;
+}
+
+def ATOMIC_STORE_HINT_B : BaseStoreHintPseudo<GPR32>;
+def ATOMIC_STORE_HINT_H : BaseStoreHintPseudo<GPR32>;
+def ATOMIC_STORE_HINT_S : BaseStoreHintPseudo<GPR32>;
+def ATOMIC_STORE_HINT_D : BaseStoreHintPseudo<GPR64>;
+
+class atomic_hint_store<PatFrag Base, bit Rel, bit SeqCst, code Pred, code GIPred>
+  : PatFrag<(ops node:$ptr, node:$val),
----------------
Lukacma wrote:

Why is the pattFrag swapping the operands ?

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


More information about the cfe-commits mailing list