[clang] [llvm] [AArch64] Implement the atomic fetch with hint intrinsic (PR #227711)

via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 7 05:16:25 PDT 2026


github-actions[bot] wrote:

<!--PREMERGE ADVISOR COMMENT: Linux-->
# :penguin: Linux x64 Test Results

* 154965 tests passed
* 3498 tests skipped
* 1 test failed

## Failed Tests
(click on a test name to see its output)

### Clang
<details>
<summary>Clang.CodeGen/builtins-arm64.c</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 1
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/24/include -nostdsysteminc -triple arm64-unknown-linux -disable-O0-optnone -emit-llvm -o - /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/builtins-arm64.c | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/opt -S -passes=mem2reg | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/builtins-arm64.c --check-prefix=CHECK --check-prefix=CHECK-LINUX
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/24/include -nostdsysteminc -triple arm64-unknown-linux -disable-O0-optnone -emit-llvm -o - /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/builtins-arm64.c
# .---command stderr------------
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/builtins-arm64.c:243:3: warning: unrecognised hint type argument to atomic hint operation (5) [-Watomic-hint-type]
# |   243 |   __builtin_arm_atomic_store_with_hint(a, b, __ATOMIC_RELAXED, 5); // Invalid Hint
# |       |   ^                                                            ~
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/builtins-arm64.c:244:3: warning: unrecognised hint type argument to atomic hint operation (5) [-Watomic-hint-type]
# |   244 |   __builtin_arm_atomic_store_with_hint(a, b, __ATOMIC_RELAXED, 5); // Invalid Hint
# |       |   ^                                                            ~
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/builtins-arm64.c:306:3: warning: unrecognised hint type argument to atomic hint operation (0) [-Watomic-hint-type]
# |   306 |   __builtin_arm_atomic_fetch_add_with_hint(a, b, __ATOMIC_RELAXED, HINT_STSHH_KEEP);
# |       |   ^                                                                ~~~~~~~~~~~~~~~
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/builtins-arm64.c:307:3: warning: unrecognised hint type argument to atomic hint operation (1) [-Watomic-hint-type]
# |   307 |   __builtin_arm_atomic_fetch_sub_with_hint(a, b, __ATOMIC_RELAXED, HINT_STSHH_STRM);
# |       |   ^                                                                ~~~~~~~~~~~~~~~
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/builtins-arm64.c:308:3: warning: unrecognised hint type argument to atomic hint operation (2) [-Watomic-hint-type]
# |   308 |   __builtin_arm_atomic_fetch_and_with_hint(a, b, __ATOMIC_RELAXED, HINT_STCPH);
# |       |   ^                                                                ~~~~~~~~~~
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/builtins-arm64.c:309:10: warning: unrecognised hint type argument to atomic hint operation (5) [-Watomic-hint-type]
# |   309 |   return __builtin_arm_atomic_fetch_add_with_hint(a, b, __ATOMIC_RELAXED, 5);
# |       |          ^                                                                ~
# | 6 warnings generated.
# `-----------------------------
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/opt -S -passes=mem2reg
# note: command had no output on stdout or stderr
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/builtins-arm64.c --check-prefix=CHECK --check-prefix=CHECK-LINUX
# .---command stderr------------
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/builtins-arm64.c:247:17: error: CHECK-NEXT: is not on the line after the previous match
# |  // CHECK-NEXT: ret void
# |                 ^
# | <stdin>:278:2: note: 'next' match was here
# |  ret void
# |  ^
# | <stdin>:276:48: note: previous match ended here
# |  store atomic i64 %b, ptr %a monotonic, align 8
# |                                                ^
# | <stdin>:277:1: note: non-matching line after previous match is here
# |  store atomic i64 %b, ptr %a monotonic, align 8
# | ^
# | 
# | Input file: <stdin>
# | Check file: /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/builtins-arm64.c
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |             .
# |             .
# |             .
# |           271:  store atomic i64 %b, ptr %a release, align 8, !mem.cache_hint !10 
# |           272:  store atomic i64 %b, ptr %a release, align 8, !mem.cache_hint !10 
# |           273:  store atomic i64 %b, ptr %a monotonic, align 8, !mem.cache_hint !12 
# |           274:  store atomic i64 %b, ptr %a release, align 8, !mem.cache_hint !14 
# |           275:  store atomic i64 %b, ptr %a seq_cst, align 8, !mem.cache_hint !16 
# |           276:  store atomic i64 %b, ptr %a monotonic, align 8 
# | next:247'0                                                   {   search range start (exclusive)
# |           277:  store atomic i64 %b, ptr %a monotonic, align 8 
# |           278:  ret void 
# | next:247'1      !~~~~~~~   error: match on wrong line
# |           279: } 
# |           280:  
# |           281: ; Function Attrs: noinline nounwind 
# |           282: define dso_local i64 @atomic_fetch_add_with_hint(ptr noundef %a, i64 noundef %b) #0 { 
# | next:247'2                                                      }                                      search range end (exclusive)
# |           283: entry: 
# |           284:  %0 = atomicrmw add ptr %a, i64 %b monotonic, align 8, !mem.cache_hint !18 
# |           285:  ret i64 %0 
# |           286: } 
# |           287:  
# |             .
# |             .
# |             .
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--

```
</details>

If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label.

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


More information about the cfe-commits mailing list