[llvm] Revert "Revert "[AA] Improve precision for monotonic atomic load/stor… (PR #195015)

via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 30 00:05:38 PDT 2026


github-actions[bot] wrote:

<!--PREMERGE ADVISOR COMMENT: Windows-->
# :window: Windows x64 Test Results

* 134065 tests passed
* 3188 tests skipped
* 2 tests failed

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

### LLVM
<details>
<summary>LLVM.Analysis/BasicAA/atomics.ll</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 1
c:\_work\llvm-project\llvm-project\build\bin\opt.exe -passes=aa-eval -print-all-alias-modref-info -disable-output 2>&1 C:\_work\llvm-project\llvm-project\llvm\test\Analysis\BasicAA\atomics.ll | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\llvm\test\Analysis\BasicAA\atomics.ll
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\opt.exe' -passes=aa-eval -print-all-alias-modref-info -disable-output 'C:\_work\llvm-project\llvm-project\llvm\test\Analysis\BasicAA\atomics.ll'
# note: command had no output on stdout or stderr
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' 'C:\_work\llvm-project\llvm-project\llvm\test\Analysis\BasicAA\atomics.ll'
# .---command stderr------------
# | C:\_work\llvm-project\llvm-project\llvm\test\Analysis\BasicAA\atomics.ll:11:10: error: CHECK: expected string not found in input
# | ; CHECK: Both ModRef: Ptr: i32* %a <-> %3 = load atomic i32, ptr %x monotonic, align 4
# |          ^
# | <stdin>:6:94: note: scanning from here
# |  Both ModRef: Ptr: i32* %x <-> %2 = cmpxchg ptr %x, i32 0, i32 1 monotonic monotonic, align 4
# |                                                                                              ^
# | <stdin>:8:2: note: possible intended match here
# |  Both ModRef: Ptr: i32* %x <-> %3 = load atomic i32, ptr %x monotonic, align 4
# |  ^
# | 
# | Input file: <stdin>
# | Check file: C:\_work\llvm-project\llvm-project\llvm\test\Analysis\BasicAA\atomics.ll
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |             1: Function: alloca_no_escape: 2 pointers, 14 call sites 
# |             2:  NoAlias: i32* %a, i32* %x 
# |             3:  NoModRef: Ptr: i32* %a <-> %1 = atomicrmw add ptr %x, i32 1 monotonic, align 4 
# |             4:  Both ModRef: Ptr: i32* %x <-> %1 = atomicrmw add ptr %x, i32 1 monotonic, align 4 
# |             5:  NoModRef: Ptr: i32* %a <-> %2 = cmpxchg ptr %x, i32 0, i32 1 monotonic monotonic, align 4 
# |             6:  Both ModRef: Ptr: i32* %x <-> %2 = cmpxchg ptr %x, i32 0, i32 1 monotonic monotonic, align 4 
# | check:11'0                                                                                                  X error: no match found
# |             7:  NoModRef: Ptr: i32* %a <-> %3 = load atomic i32, ptr %x monotonic, align 4 
# | check:11'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             8:  Both ModRef: Ptr: i32* %x <-> %3 = load atomic i32, ptr %x monotonic, align 4 
# | check:11'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | check:11'1      ?                                                                              possible intended match
# |             9:  NoModRef: Ptr: i32* %a <-> store atomic i32 0, ptr %x monotonic, align 4 
# | check:11'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            10:  Both ModRef: Ptr: i32* %x <-> store atomic i32 0, ptr %x monotonic, align 4 
# | check:11'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            11:  Both ModRef: Ptr: i32* %a <-> fence release 
# | check:11'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            12:  Both ModRef: Ptr: i32* %x <-> fence release 
# | check:11'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            13:  Both ModRef: Ptr: i32* %a <-> %4 = atomicrmw add ptr %x, i32 1 acq_rel, align 4 
# | check:11'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             .
# |             .
# |             .
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--

```
</details>
<details>
<summary>LLVM.Transforms/DeadStoreElimination/atomic.ll</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 2
c:\_work\llvm-project\llvm-project\build\bin\opt.exe -passes=dse -S < C:\_work\llvm-project\llvm-project\llvm\test\Transforms\DeadStoreElimination\atomic.ll | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\llvm\test\Transforms\DeadStoreElimination\atomic.ll
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\opt.exe' -passes=dse -S
# note: command had no output on stdout or stderr
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' 'C:\_work\llvm-project\llvm-project\llvm\test\Transforms\DeadStoreElimination\atomic.ll'
# .---command stderr------------
# | C:\_work\llvm-project\llvm-project\llvm\test\Transforms\DeadStoreElimination\atomic.ll:409:14: error: CHECK-NOT: excluded string found in input
# | ; CHECK-NOT: store i64 0, ptr %version_ptr
# |              ^
# | <stdin>:202:2: note: found here
# |  store i64 0, ptr %version_ptr, align 8
# |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | C:\_work\llvm-project\llvm-project\llvm\test\Transforms\DeadStoreElimination\atomic.ll:410:14: error: CHECK-NOT: excluded string found in input
# | ; CHECK-NOT: store i64 4096, ptr %start_ip_ptr
# |              ^
# | <stdin>:204:2: note: found here
# |  store i64 4096, ptr %start_ip_ptr, align 8
# |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | C:\_work\llvm-project\llvm-project\llvm\test\Transforms\DeadStoreElimination\atomic.ll:411:14: error: CHECK-NOT: excluded string found in input
# | ; CHECK-NOT: store i64 8192, ptr %abort_ip_ptr
# |              ^
# | <stdin>:206:2: note: found here
# |  store i64 8192, ptr %abort_ip_ptr, align 8
# |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | 
# | Input file: <stdin>
# | Check file: C:\_work\llvm-project\llvm-project\llvm\test\Transforms\DeadStoreElimination\atomic.ll
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |          .
# |          .
# |          .
# |        197:  
# |        198: define void @test_atomic_monotonic_escape() { 
# |        199: entry: 
# |        200:  %cs = alloca { i64, i64, i64 }, align 8 
# |        201:  %version_ptr = getelementptr inbounds { i64, i64, i64 }, ptr %cs, i32 0, i32 0 
# |        202:  store i64 0, ptr %version_ptr, align 8 
# | not:409      !~~~~~~~~~~~~~~~~~~~~~~~~~~~~           error: no match expected
# |        203:  %start_ip_ptr = getelementptr inbounds { i64, i64, i64 }, ptr %cs, i32 0, i32 1 
# |        204:  store i64 4096, ptr %start_ip_ptr, align 8 
# | not:410      !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~           error: no match expected
# |        205:  %abort_ip_ptr = getelementptr inbounds { i64, i64, i64 }, ptr %cs, i32 0, i32 2 
# |        206:  store i64 8192, ptr %abort_ip_ptr, align 8 
# | not:411      !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~           error: no match expected
# |        207:  store atomic ptr %cs, ptr @global_ptr monotonic, align 8 
# |        208:  call void @external_sync() 
# |        209:  ret void 
# |        210: } 
# | >>>>>>
# `-----------------------------
# 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/195015


More information about the llvm-commits mailing list