[llvm] [SROA] Extend SROA to support dynamic indexing (PR #217188)

via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 19 11:52:15 PDT 2026


github-actions[bot] wrote:

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

* 180839 tests passed
* 3701 tests skipped
* 1 test failed

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

### LLVM
<details>
<summary>LLVM.CodeGen/AMDGPU/promote-alloca-vector-to-vector.ll</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 1
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/llc -mtriple=amdgpu8.03 < /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/AMDGPU/promote-alloca-vector-to-vector.ll | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck -enable-var-scope -check-prefix=GCN /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/AMDGPU/promote-alloca-vector-to-vector.ll
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/llc -mtriple=amdgpu8.03
# note: command had no output on stdout or stderr
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck -enable-var-scope -check-prefix=GCN /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/AMDGPU/promote-alloca-vector-to-vector.ll
# note: command had no output on stdout or stderr
# RUN: at line 2
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/llc -mtriple=amdgpu9.00 < /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/AMDGPU/promote-alloca-vector-to-vector.ll | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck -enable-var-scope -check-prefix=GCN /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/AMDGPU/promote-alloca-vector-to-vector.ll
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/llc -mtriple=amdgpu9.00
# note: command had no output on stdout or stderr
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck -enable-var-scope -check-prefix=GCN /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/AMDGPU/promote-alloca-vector-to-vector.ll
# note: command had no output on stdout or stderr
# RUN: at line 3
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/opt -S -mtriple=amdgpu8.03-- -passes=sroa,amdgpu-promote-alloca < /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/AMDGPU/promote-alloca-vector-to-vector.ll | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck -check-prefix=OPT /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/AMDGPU/promote-alloca-vector-to-vector.ll
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/opt -S -mtriple=amdgpu8.03-- -passes=sroa,amdgpu-promote-alloca
# note: command had no output on stdout or stderr
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck -check-prefix=OPT /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/AMDGPU/promote-alloca-vector-to-vector.ll
# .---command stderr------------
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/AMDGPU/promote-alloca-vector-to-vector.ll:14:8: error: OPT: expected string not found in input
# | ; OPT: %0 = extractelement <4 x float> <float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00>, i32 %sel2
# |        ^
# | <stdin>:6:48: note: scanning from here
# | define amdgpu_kernel void @float4_alloca_store4(ptr addrspace(1) %out, ptr addrspace(3) %dummy_lds) {
# |                                                ^
# | <stdin>:18:2: note: possible intended match here
# |  %1 = extractelement <4 x float> <float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00>, i32 %0
# |  ^
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/AMDGPU/promote-alloca-vector-to-vector.ll:46:8: error: OPT: expected string not found in input
# | ; OPT: %0 = insertelement <4 x float> poison, float 1.000000e+00, i32 %sel2
# |        ^
# | <stdin>:23:47: note: scanning from here
# | define amdgpu_kernel void @float4_alloca_load4(ptr addrspace(1) %out, ptr addrspace(3) %dummy_lds) {
# |                                               ^
# | <stdin>:35:2: note: possible intended match here
# |  %1 = insertelement <4 x float> poison, float 1.000000e+00, i32 %0
# |  ^
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/AMDGPU/promote-alloca-vector-to-vector.ll:74:8: error: OPT: expected string not found in input
# | ; OPT: %0 = extractelement <4 x half> <half 1.000000e+00, half 2.000000e+00, half 3.000000e+00, half 4.000000e+00>, i32 %sel2
# |        ^
# | <stdin>:40:47: note: scanning from here
# | define amdgpu_kernel void @half4_alloca_store4(ptr addrspace(1) %out, ptr addrspace(3) %dummy_lds) {
# |                                               ^
# | <stdin>:52:2: note: possible intended match here
# |  %1 = extractelement <4 x half> <half 1.000000e+00, half 2.000000e+00, half 3.000000e+00, half 4.000000e+00>, i32 %0
# |  ^
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/AMDGPU/promote-alloca-vector-to-vector.ll:100:8: error: OPT: expected string not found in input
# | ; OPT: %0 = insertelement <4 x half> %alloca, half 1.000000e+00, i32 %sel2
# |        ^
# | <stdin>:59:36: note: scanning from here
# |  %alloca = freeze <4 x half> poison
# |                                    ^
# | <stdin>:69:2: note: possible intended match here
# |  %1 = insertelement <4 x half> %alloca, half 1.000000e+00, i32 %0
# |  ^
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/AMDGPU/promote-alloca-vector-to-vector.ll:127:8: error: OPT: expected string not found in input
# | ; OPT: %0 = extractelement <4 x i16> <i16 1, i16 2, i16 3, i16 4>, i32 %sel2
# |        ^
# | <stdin>:74:48: note: scanning from here
# | define amdgpu_kernel void @short4_alloca_store4(ptr addrspace(1) %out, ptr addrspace(3) %dummy_lds) {
# |                                                ^
# | <stdin>:86:2: note: possible intended match here
# |  %1 = extractelement <4 x i16> <i16 1, i16 2, i16 3, i16 4>, i32 %0
# |  ^
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/AMDGPU/promote-alloca-vector-to-vector.ll:153:8: error: OPT: expected string not found in input
# | ; OPT: %0 = insertelement <4 x i16> %alloca, i16 1, i32 %sel2
# |        ^
# | <stdin>:93:35: note: scanning from here
# |  %alloca = freeze <4 x i16> poison
# |                                   ^
# | <stdin>:103:2: note: possible intended match here
# |  %1 = insertelement <4 x i16> %alloca, i16 1, i32 %0
# |  ^
# | 
# | Input file: <stdin>
# | Check file: /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/AMDGPU/promote-alloca-vector-to-vector.ll
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |              1: ; ModuleID = '<stdin>' 
# |              2: source_filename = "<stdin>" 
# |              3: target datalayout = "e-m:e-p:64:64-p1:64:64-p2:32:32-p3:32:32-p4:64:64-p5:32:32-p6:32:32-p7:160:256:256:32-p8:128:128:128:48-p9:192:256:256:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-S32-A5-G1-ni:7:8:9" 
# |              4: target triple = "amdgpu8.03-unknown-unknown" 
# |              5:  
# |              6: define amdgpu_kernel void @float4_alloca_store4(ptr addrspace(1) %out, ptr addrspace(3) %dummy_lds) { 
# | check:14'0                                                    {                                                         search range start (exclusive)
# | check:14'1                                                                                                              error: no match found in search range
# |              7: entry: 
# |              8:  %alloca = freeze <4 x float> poison 
# |              9:  %x = tail call i32 @llvm.amdgcn.workitem.id.x() 
# |             10:  %y = tail call i32 @llvm.amdgcn.workitem.id.y() 
# |             11:  %c1 = icmp uge i32 %x, 3 
# |             12:  %c2 = icmp uge i32 %y, 3 
# |             13:  %sel1 = select i1 %c1, i32 1, i32 2 
# |             14:  %sel2 = select i1 %c2, i32 0, i32 %sel1 
# |             15:  %alloca.0.gep.sroa_stride = mul i32 %sel2, 4 
# |             16:  %alloca.0.gep.sroa_offset = add i32 0, %alloca.0.gep.sroa_stride 
# |             17:  %0 = ashr exact i32 %alloca.0.gep.sroa_offset, 2 
# |             18:  %1 = extractelement <4 x float> <float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00>, i32 %0 
# | check:14'2       ?                                                                                                                          possible intended match
# |             19:  store float %1, ptr addrspace(1) %out, align 4 
# |             20:  ret void 
# |             21: } 
# |             22:  
# |             23: define amdgpu_kernel void @float4_alloca_load4(ptr addrspace(1) %out, ptr addrspace(3) %dummy_lds) { 
# | check:14'3                                                    }                                                        search range end (exclusive)
# | check:46'0                                                   {                                                         search range start (exclusive)
# | check:46'1                                                                                                             error: no match found in search range
# |             24: entry: 
# |             25:  %alloca = freeze <4 x float> poison 
# |             26:  %x = tail call i32 @llvm.amdgcn.workitem.id.x() 
# |             27:  %y = tail call i32 @llvm.amdgcn.workitem.id.y() 
# |             28:  %c1 = icmp uge i32 %x, 3 
# |             29:  %c2 = icmp uge i32 %y, 3 
# |             30:  %sel1 = select i1 %c1, i32 1, i32 2 
# |             31:  %sel2 = select i1 %c2, i32 0, i32 %sel1 
# |             32:  %alloca.0.gep.sroa_stride = mul i32 %sel2, 4 
# |             33:  %alloca.0.gep.sroa_offset = add i32 0, %alloca.0.gep.sroa_stride 
# |             34:  %0 = ashr exact i32 %alloca.0.gep.sroa_offset, 2 
# |             35:  %1 = insertelement <4 x float> poison, float 1.000000e+00, i32 %0 
# | check:46'2       ?                                                                   possible intended match
# |             36:  store <4 x float> %1, ptr addrspace(1) %out, align 4 
# |             37:  ret void 
# |             38: } 
# |             39:  
# |             40: define amdgpu_kernel void @half4_alloca_store4(ptr addrspace(1) %out, ptr addrspace(3) %dummy_lds) { 
# | check:46'3                                                    }                                                        search range end (exclusive)
# | check:74'0                                                   {                                                         search range start (exclusive)
# | check:74'1                                                                                                             error: no match found in search range
# |             41: entry: 
# |             42:  %alloca = freeze <4 x half> poison 
# |             43:  %x = tail call i32 @llvm.amdgcn.workitem.id.x() 
# |             44:  %y = tail call i32 @llvm.amdgcn.workitem.id.y() 
# |             45:  %c1 = icmp uge i32 %x, 3 
# |             46:  %c2 = icmp uge i32 %y, 3 
# |             47:  %sel1 = select i1 %c1, i32 1, i32 2 
# |             48:  %sel2 = select i1 %c2, i32 0, i32 %sel1 
# |             49:  %alloca.0.gep.sroa_stride = mul i32 %sel2, 2 
# |             50:  %alloca.0.gep.sroa_offset = add i32 0, %alloca.0.gep.sroa_stride 
# |             51:  %0 = ashr exact i32 %alloca.0.gep.sroa_offset, 1 
# |             52:  %1 = extractelement <4 x half> <half 1.000000e+00, half 2.000000e+00, half 3.000000e+00, half 4.000000e+00>, i32 %0 
# | check:74'2       ?                                                                                                                     possible intended match
# |             53:  store half %1, ptr addrspace(1) %out, align 2 
# |             54:  ret void 
# |             55: } 
# |             56:  
# |             57: define amdgpu_kernel void @half4_alloca_load4(ptr addrspace(1) %out, ptr addrspace(3) %dummy_lds) { 
# | check:74'3                                                   }                                                        search range end (exclusive)
# |             58: entry: 
# |             59:  %alloca = freeze <4 x half> poison 
# | check:100'0                                       {   search range start (exclusive)
# | check:100'1                                           error: no match found in search range
# |             60:  %x = tail call i32 @llvm.amdgcn.workitem.id.x() 
# |             61:  %y = tail call i32 @llvm.amdgcn.workitem.id.y() 
# |             62:  %c1 = icmp uge i32 %x, 3 
# |             63:  %c2 = icmp uge i32 %y, 3 
# |             64:  %sel1 = select i1 %c1, i32 1, i32 2 
# |             65:  %sel2 = select i1 %c2, i32 0, i32 %sel1 
# |             66:  %alloca.0.gep.sroa_stride = mul i32 %sel2, 2 
# |             67:  %alloca.0.gep.sroa_offset = add i32 0, %alloca.0.gep.sroa_stride 
# |             68:  %0 = ashr exact i32 %alloca.0.gep.sroa_offset, 1 
# |             69:  %1 = insertelement <4 x half> %alloca, half 1.000000e+00, i32 %0 
# | check:100'2      ?                                                                  possible intended match
# |             70:  store <4 x half> %1, ptr addrspace(1) %out, align 2 
# |             71:  ret void 
# |             72: } 
# |             73:  
# |             74: define amdgpu_kernel void @short4_alloca_store4(ptr addrspace(1) %out, ptr addrspace(3) %dummy_lds) { 
# | check:100'3                            
# | ...
# `---data was truncated (10240/13343) (change limit with -D output_limit=N)
# 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/217188


More information about the llvm-commits mailing list