[llvm] [AMDGPU] Use alias analysis for SMEM/VMEM WAR waitcnts (PR #206569)

via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 29 12:59:58 PDT 2026


github-actions[bot] wrote:

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

* 136342 tests passed
* 3506 tests skipped
* 4 tests failed

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

### LLVM
<details>
<summary>LLVM.CodeGen/AMDGPU/GlobalISel/insertelement-stack-lower.ll</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 2
c:\_work\llvm-project\llvm-project\build\bin\llc.exe -global-isel -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 < C:\_work\llvm-project\llvm-project\llvm\test\CodeGen\AMDGPU\GlobalISel\insertelement-stack-lower.ll | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe -check-prefixes=GCN C:\_work\llvm-project\llvm-project\llvm\test\CodeGen\AMDGPU\GlobalISel\insertelement-stack-lower.ll
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\llc.exe' -global-isel -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900
# note: command had no output on stdout or stderr
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' -check-prefixes=GCN 'C:\_work\llvm-project\llvm-project\llvm\test\CodeGen\AMDGPU\GlobalISel\insertelement-stack-lower.ll'
# .---command stderr------------
# | C:\_work\llvm-project\llvm-project\llvm\test\CodeGen\AMDGPU\GlobalISel\insertelement-stack-lower.ll:37:13: error: GCN-NEXT: is not on the line after the previous match
# | ; GCN-NEXT: buffer_store_dword v0, off, s[0:3], 0
# |             ^
# | <stdin>:37:2: note: 'next' match was here
# |  buffer_store_dword v0, off, s[0:3], 0
# |  ^
# | <stdin>:35:42: note: previous match ended here
# |  s_load_dwordx16 s[36:51], s[22:23], 0xc0
# |                                          ^
# | <stdin>:36:1: note: non-matching line after previous match is here
# |  s_waitcnt lgkmcnt(0)
# | ^
# | 
# | Input file: <stdin>
# | Check file: C:\_work\llvm-project\llvm-project\llvm\test\CodeGen\AMDGPU\GlobalISel\insertelement-stack-lower.ll
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |            .
# |            .
# |            .
# |           30:  v_mov_b32_e32 v11, s47 
# |           31:  v_mov_b32_e32 v12, s48 
# |           32:  v_mov_b32_e32 v13, s49 
# |           33:  v_mov_b32_e32 v14, s50 
# |           34:  v_mov_b32_e32 v15, s51 
# |           35:  s_load_dwordx16 s[36:51], s[22:23], 0xc0 
# | next:37'0                                             {   search range start (exclusive)
# |           36:  s_waitcnt lgkmcnt(0) 
# |           37:  buffer_store_dword v0, off, s[0:3], 0 
# | next:37'1      !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   error: match on wrong line
# |           38:  buffer_store_dword v1, off, s[0:3], 0 offset:4 
# |           39:  buffer_store_dword v2, off, s[0:3], 0 offset:8 
# |           40:  buffer_store_dword v3, off, s[0:3], 0 offset:12 
# |           41:  buffer_store_dword v4, off, s[0:3], 0 offset:16 
# |           42:  buffer_store_dword v5, off, s[0:3], 0 offset:20 
# |            .
# |            .
# |            .
# |          429: amdhsa.version: 
# |          430:  - 1 
# |          431:  - 2 
# |          432: ... 
# |          433:  
# |          434:  .end_amdgpu_metadata 
# | next:37'2                           } search range end (exclusive)
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--

```
</details>
<details>
<summary>LLVM.CodeGen/AMDGPU/any_extend_vector_inreg.ll</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 2
c:\_work\llvm-project\llvm-project\build\bin\llc.exe -mtriple=amdgcn -mcpu=gfx600 < C:\_work\llvm-project\llvm-project\llvm\test\CodeGen\AMDGPU\any_extend_vector_inreg.ll | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe -check-prefix=GFX6 C:\_work\llvm-project\llvm-project\llvm\test\CodeGen\AMDGPU\any_extend_vector_inreg.ll
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\llc.exe' -mtriple=amdgcn -mcpu=gfx600
# note: command had no output on stdout or stderr
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' -check-prefix=GFX6 'C:\_work\llvm-project\llvm-project\llvm\test\CodeGen\AMDGPU\any_extend_vector_inreg.ll'
# .---command stderr------------
# | C:\_work\llvm-project\llvm-project\llvm\test\CodeGen\AMDGPU\any_extend_vector_inreg.ll:19:14: error: GFX6-NEXT: is not on the line after the previous match
# | ; GFX6-NEXT: buffer_store_byte v0, off, s[12:15], 0 offset:13
# |              ^
# | <stdin>:29:2: note: 'next' match was here
# |  buffer_store_byte v0, off, s[12:15], 0 offset:13
# |  ^
# | <stdin>:27:20: note: previous match ended here
# |  s_mov_b32 s13, s11
# |                    ^
# | <stdin>:28:1: note: non-matching line after previous match is here
# |  s_waitcnt lgkmcnt(0)
# | ^
# | 
# | Input file: <stdin>
# | Check file: C:\_work\llvm-project\llvm-project\llvm\test\CodeGen\AMDGPU\any_extend_vector_inreg.ll
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |            .
# |            .
# |            .
# |           22:  s_waitcnt lgkmcnt(0) 
# |           23:  s_load_dwordx8 s[0:7], s[8:9], 0x0 
# |           24:  s_waitcnt lgkmcnt(0) 
# |           25:  s_load_dword s0, s[8:9], 0x8 
# |           26:  s_mov_b32 s12, s10 
# |           27:  s_mov_b32 s13, s11 
# | next:19'0                       {   search range start (exclusive)
# |           28:  s_waitcnt lgkmcnt(0) 
# |           29:  buffer_store_byte v0, off, s[12:15], 0 offset:13 
# | next:19'1      !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   error: match on wrong line
# |           30:  s_lshr_b32 s3, s5, 16 
# |           31:  v_mov_b32_e32 v1, s7 
# |           32:  s_lshl_b64 s[4:5], s[0:1], 8 
# |           33:  s_lshr_b64 s[2:3], s[2:3], 16 
# |           34:  buffer_store_byte v0, off, s[12:15], 0 offset:15 
# |            .
# |            .
# |            .
# |           98:  .set amdgpu.max_num_agpr, 0 
# |           99:  .set amdgpu.max_num_sgpr, 0 
# |          100:  .set amdgpu.max_num_named_barrier, 0 
# |          101:  .section .AMDGPU.csdata,"", at progbits 
# |          102:  .section ".note.GNU-stack","", at progbits 
# |          103:  .amd_amdgpu_isa "amdgcn-unknown-unknown-unknown-gfx600" 
# | next:19'2                                                              } search range end (exclusive)
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--

```
</details>
<details>
<summary>LLVM.CodeGen/AMDGPU/loop-prefetch-data.ll</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 2
c:\_work\llvm-project\llvm-project\build\bin\llc.exe -mtriple=amdgcn -mcpu=gfx1200 -amdgpu-loop-prefetch < C:\_work\llvm-project\llvm-project\llvm\test\CodeGen\AMDGPU\loop-prefetch-data.ll | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe --check-prefix=GFX12 C:\_work\llvm-project\llvm-project\llvm\test\CodeGen\AMDGPU\loop-prefetch-data.ll
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\llc.exe' -mtriple=amdgcn -mcpu=gfx1200 -amdgpu-loop-prefetch
# note: command had no output on stdout or stderr
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' --check-prefix=GFX12 'C:\_work\llvm-project\llvm-project\llvm\test\CodeGen\AMDGPU\loop-prefetch-data.ll'
# note: command had no output on stdout or stderr
# RUN: at line 3
c:\_work\llvm-project\llvm-project\build\bin\llc.exe -mtriple=amdgcn -mcpu=gfx1200 -amdgpu-loop-prefetch -mattr=+safe-smem-prefetch < C:\_work\llvm-project\llvm-project\llvm\test\CodeGen\AMDGPU\loop-prefetch-data.ll | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe --check-prefix=GFX12-SPREFETCH C:\_work\llvm-project\llvm-project\llvm\test\CodeGen\AMDGPU\loop-prefetch-data.ll
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\llc.exe' -mtriple=amdgcn -mcpu=gfx1200 -amdgpu-loop-prefetch -mattr=+safe-smem-prefetch
# note: command had no output on stdout or stderr
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' --check-prefix=GFX12-SPREFETCH 'C:\_work\llvm-project\llvm-project\llvm\test\CodeGen\AMDGPU\loop-prefetch-data.ll'
# .---command stderr------------
# | C:\_work\llvm-project\llvm-project\llvm\test\CodeGen\AMDGPU\loop-prefetch-data.ll:63:25: error: GFX12-SPREFETCH-NEXT: is not on the line after the previous match
# | ; GFX12-SPREFETCH-NEXT: flat_store_b128 v[4:5], v[0:3]
# |                         ^
# | <stdin>:42:2: note: 'next' match was here
# |  flat_store_b128 v[4:5], v[0:3]
# |  ^
# | <stdin>:40:26: note: previous match ended here
# |  s_wait_loadcnt_dscnt 0x0
# |                          ^
# | <stdin>:41:1: note: non-matching line after previous match is here
# |  s_wait_kmcnt 0x0
# | ^
# | C:\_work\llvm-project\llvm-project\llvm\test\CodeGen\AMDGPU\loop-prefetch-data.ll:192:25: error: GFX12-SPREFETCH-NEXT: is not on the line after the previous match
# | ; GFX12-SPREFETCH-NEXT: global_store_b128 v0, v[1:4], s[0:1]
# |                         ^
# | <stdin>:117:2: note: 'next' match was here
# |  global_store_b128 v0, v[1:4], s[0:1]
# |  ^
# | <stdin>:115:20: note: previous match ended here
# |  s_wait_loadcnt 0x0
# |                    ^
# | <stdin>:116:1: note: non-matching line after previous match is here
# |  s_wait_kmcnt 0x0
# | ^
# | 
# | Input file: <stdin>
# | Check file: C:\_work\llvm-project\llvm-project\llvm\test\CodeGen\AMDGPU\loop-prefetch-data.ll
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |             .
# |             .
# |             .
# |            35:  s_add_co_i32 s6, s6, -1 
# |            36:  s_add_nc_u64 s[2:3], s[2:3], 16 
# |            37:  flat_load_b128 v[0:3], v[0:1] 
# |            38:  s_cmp_lg_u32 s6, 0 
# |            39:  s_add_nc_u64 s[0:1], s[0:1], 16 
# |            40:  s_wait_loadcnt_dscnt 0x0 
# | next:63'0                              {   search range start (exclusive)
# |            41:  s_wait_kmcnt 0x0 
# |            42:  flat_store_b128 v[4:5], v[0:3] 
# | next:63'1       !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   error: match on wrong line
# |            43:  s_cbranch_scc1 .LBB0_2 
# |            44: .LBB0_3: ; %for.end 
# |            45:  s_endpgm 
# |            46: .Lfunc_end0: 
# |            47:  .size copy_flat, .Lfunc_end0-copy_flat 
# |             .
# |             .
# |             .
# |            92:  .long 0 
# |            93:  .text 
# |            94:  .globl copy_global ; -- Begin function copy_global 
# |            95:  .p2align 8 
# |            96:  .type copy_global, at function 
# |            97: copy_global: ; @copy_global 
# | next:63'2                  }                 search range end (exclusive)
# |            98: ; %bb.0: ; %entry 
# |            99:  s_load_b32 s6, s[4:5], 0x34 
# |           100:  s_wait_kmcnt 0x0 
# |           101:  s_cmp_eq_u32 s6, 0 
# |           102:  s_cbranch_scc1 .LBB1_3 
# |             .
# |             .
# |             .
# |           110:  s_prefetch_data s[2:3], 0x0, null, 0 
# |           111:  global_load_b128 v[1:4], v0, s[2:3] offset:-176 
# |           112:  s_add_co_i32 s6, s6, -1 
# |           113:  s_add_nc_u64 s[2:3], s[2:3], 16 
# |           114:  s_cmp_lg_u32 s6, 0 
# |           115:  s_wait_loadcnt 0x0 
# | next:192'0                       {   search range start (exclusive)
# |           116:  s_wait_kmcnt 0x0 
# |           117:  global_store_b128 v0, v[1:4], s[0:1] 
# | next:192'1      !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   error: match on wrong line
# |           118:  s_add_nc_u64 s[0:1], s[0:1], 16 
# |           119:  s_cbranch_scc1 .LBB1_2 
# |           120: .LBB1_3: ; %for.end 
# |           121:  s_endpgm 
# |           122: .Lfunc_end1: 
# |             .
# |             .
# |             .
# |           168:  .long 0 
# |           169:  .text 
# |           170:  .globl copy_constant ; -- Begin function copy_constant 
# |           171:  .p2align 8 
# |           172:  .type copy_constant, at function 
# |           173: copy_constant: ; @copy_constant 
# | next:192'2                   }                   search range end (exclusive)
# |           174: ; %bb.0: ; %entry 
# |           175:  s_load_b32 s6, s[4:5], 0x34 
# |           176:  s_wait_kmcnt 0x0 
# |           177:  s_cmp_eq_u32 s6, 0 
# |           178:  s_cbranch_scc1 .LBB2_3 
# |             .
# |             .
# |             .
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--

```
</details>
<details>
<summary>LLVM.CodeGen/AMDGPU/si-triv-disjoint-mem-access.ll</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 2
c:\_work\llvm-project\llvm-project\build\bin\llc.exe -amdgpu-scalarize-global-loads=false  -mtriple=amdgcn -mcpu=bonaire -enable-amdgpu-aa=0 -enable-misched -enable-aa-sched-mi < C:\_work\llvm-project\llvm-project\llvm\test\CodeGen\AMDGPU\si-triv-disjoint-mem-access.ll | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe -enable-var-scope -check-prefix=CI C:\_work\llvm-project\llvm-project\llvm\test\CodeGen\AMDGPU\si-triv-disjoint-mem-access.ll
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\llc.exe' -amdgpu-scalarize-global-loads=false -mtriple=amdgcn -mcpu=bonaire -enable-amdgpu-aa=0 -enable-misched -enable-aa-sched-mi
# note: command had no output on stdout or stderr
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' -enable-var-scope -check-prefix=CI 'C:\_work\llvm-project\llvm-project\llvm\test\CodeGen\AMDGPU\si-triv-disjoint-mem-access.ll'
# .---command stderr------------
# | C:\_work\llvm-project\llvm-project\llvm\test\CodeGen\AMDGPU\si-triv-disjoint-mem-access.ll:239:12: error: CI-NEXT: is not on the line after the previous match
# | ; CI-NEXT: buffer_store_dword v0, off, s[8:11], 0
# |            ^
# | <stdin>:326:2: note: 'next' match was here
# |  buffer_store_dword v0, off, s[8:11], 0
# |  ^
# | <stdin>:324:31: note: previous match ended here
# |  s_load_dword s12, s[2:3], 0x1
# |                               ^
# | <stdin>:325:1: note: non-matching line after previous match is here
# |  s_waitcnt lgkmcnt(0)
# | ^
# | 
# | Input file: <stdin>
# | Check file: C:\_work\llvm-project\llvm-project\llvm\test\CodeGen\AMDGPU\si-triv-disjoint-mem-access.ll
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |             .
# |             .
# |             .
# |           319:  s_mov_b32 s9, s3 
# |           320:  s_mov_b32 s11, s7 
# |           321:  v_readfirstlane_b32 s2, v0 
# |           322:  v_readfirstlane_b32 s3, v1 
# |           323:  v_mov_b32_e32 v0, 0x63 
# |           324:  s_load_dword s12, s[2:3], 0x1 
# | next:239'0                                  {   search range start (exclusive)
# |           325:  s_waitcnt lgkmcnt(0) 
# |           326:  buffer_store_dword v0, off, s[8:11], 0 
# | next:239'1      !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   error: match on wrong line
# |           327:  s_load_dword s2, s[2:3], 0x3 
# |           328:  s_mov_b32 s4, s0 
# |           329:  s_mov_b32 s5, s1 
# |           330:  s_waitcnt lgkmcnt(0) 
# |           331:  s_add_i32 s0, s12, s2 
# |             .
# |             .
# |             .
# |           381:  .long 0 
# |           382:  .text 
# |           383:  .globl reorder_constant_load_local_store_constant_load ; -- Begin function reorder_constant_load_local_store_constant_load 
# |           384:  .p2align 8 
# |           385:  .type reorder_constant_load_local_store_constant_load, at function 
# |           386: reorder_constant_load_local_store_constant_load: ; @reorder_constant_load_local_store_constant_load 
# | next:239'2                                                     }                                                     search range end (exclusive)
# |           387: ; %bb.0: 
# |           388:  v_mov_b32_e32 v0, 0 
# |           389:  s_mov_b32 m0, -1 
# |           390:  ds_read_b64 v[0:1], v0 
# |           391:  s_load_dwordx2 s[0:1], s[4:5], 0x9 
# |             .
# |             .
# |             .
# | >>>>>>
# `-----------------------------
# 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/206569


More information about the llvm-commits mailing list