[clang] [llvm] [AArch64] Add CMH hints to store_with_hint intrinsic (PR #227326)

Kerry McLaughlin via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 29 07:49:58 PDT 2026


================
@@ -230,13 +230,28 @@ void atomic_store_with_hint(int64_t *a, int64_t b) {
     __builtin_arm_atomic_store_with_hint(a, b, __ATOMIC_RELEASE, HINT_STSHH_STRM);
   // CHECK: store atomic i64 {{.*}}, ptr {{.*}} release, align 8, !mem.cache_hint ![[M3:[0-9]+]]
 
+  __builtin_arm_atomic_store_with_hint(a, b, __ATOMIC_RELAXED, HINT_STCPH);
+  // CHECK: store atomic i64 {{.*}}, ptr {{.*}} monotonic, align 8, !mem.cache_hint ![[M5:[0-9]+]]
+
+  __builtin_arm_atomic_store_with_hint(a, b, __ATOMIC_RELEASE, HINT_SHUH);
+  // CHECK: store atomic i64 {{.*}}, ptr {{.*}} release, align 8, !mem.cache_hint ![[M7:[0-9]+]]
+
+  __builtin_arm_atomic_store_with_hint(a, b, __ATOMIC_SEQ_CST, HINT_SHUH_PH);
+  // CHECK: store atomic i64 {{.*}}, ptr {{.*}} seq_cst, align 8, !mem.cache_hint ![[M9:[0-9]+]]
+
   // Invalid hint should be dropped
-  __builtin_arm_atomic_store_with_hint(a, b, __ATOMIC_RELAXED, 2); // Invalid Hint
-  // CHECK: store atomic i64 {{.*}}, ptr {{.*}} monotonic, align 8
+  __builtin_arm_atomic_store_with_hint(a, b, __ATOMIC_RELAXED, 5); // Invalid Hint
+  // CHECK: store atomic i64 {{.*}}, ptr {{.*}} monotonic, align 8{{$}}
----------------
kmclaughlin-arm wrote:

```suggestion
  // CHECK: store atomic i64 {{.*}}, ptr {{.*}} monotonic, align 8
```

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


More information about the llvm-commits mailing list