[clang] [AMDGPU][SPIRV] Correctly lower huge device function arguments (PR #176921)

via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 21 00:55:59 PST 2026


github-actions[bot] wrote:

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

* 85874 tests passed
* 1216 tests skipped
* 1 test failed

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

### Clang
<details>
<summary>Clang.CodeGenHIP/device-function-huge-arg-ret.hip</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/23/include -nostdsysteminc -triple spirv64-amd-amdhsa -x hip -emit-llvm -fcuda-is-device -disable-llvm-verifier -o - /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGenHIP/device-function-huge-arg-ret.hip | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGenHIP/device-function-huge-arg-ret.hip --check-prefix=CHECK-AMDGCNSPIRV
# 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/23/include -nostdsysteminc -triple spirv64-amd-amdhsa -x hip -emit-llvm -fcuda-is-device -disable-llvm-verifier -o - /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGenHIP/device-function-huge-arg-ret.hip
# 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/CodeGenHIP/device-function-huge-arg-ret.hip --check-prefix=CHECK-AMDGCNSPIRV
# note: command had no output on stdout or stderr
# RUN: at line 2
/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/23/include -nostdsysteminc -triple amdgcn-amd-amdhsa -x hip -emit-llvm -fcuda-is-device -disable-llvm-verifier -o - /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGenHIP/device-function-huge-arg-ret.hip | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGenHIP/device-function-huge-arg-ret.hip --check-prefix=CHECK-AMDGCN
# 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/23/include -nostdsysteminc -triple amdgcn-amd-amdhsa -x hip -emit-llvm -fcuda-is-device -disable-llvm-verifier -o - /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGenHIP/device-function-huge-arg-ret.hip
# 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/CodeGenHIP/device-function-huge-arg-ret.hip --check-prefix=CHECK-AMDGCN
# .---command stderr------------
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGenHIP/device-function-huge-arg-ret.hip:20:18: error: CHECK-AMDGCN: expected string not found in input
# | // CHECK-AMDGCN: define dso_local void @_Z21deviceFuncWithHugeArg11huge_struct(i16
# |                  ^
# | <stdin>:12:133: note: scanning from here
# | define dso_local void @_Z21deviceFuncWithHugeRetv(ptr addrspace(5) dead_on_unwind noalias writable sret(%struct.huge_struct) align 8 %agg.result) #0 {
# |                                                                                                                                     ^
# | <stdin>:23:1: note: possible intended match here
# | define dso_local void @_Z21deviceFuncWithHugeArg11huge_struct(ptr addrspace(5) noundef byref(%struct.huge_struct) align 8 %0) #0 {
# | ^
# | 
# | Input file: <stdin>
# | Check file: /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGenHIP/device-function-huge-arg-ret.hip
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |             .
# |             .
# |             .
# |             7:  
# |             8: @__hip_cuid_ = addrspace(1) global i8 0 
# |             9: @llvm.compiler.used = appending addrspace(1) global [1 x ptr] [ptr addrspacecast (ptr addrspace(1) @__hip_cuid_ to ptr)], section "llvm.metadata" 
# |            10:  
# |            11: ; Function Attrs: convergent mustprogress noinline nounwind optnone 
# |            12: define dso_local void @_Z21deviceFuncWithHugeRetv(ptr addrspace(5) dead_on_unwind noalias writable sret(%struct.huge_struct) align 8 %agg.result) #0 { 
# | check:20'0                                                                                                                                         X~~~~~~~~~~~~~~~~~~ error: no match found
# |            13: entry: 
# | check:20'0     ~~~~~~~
# |            14:  call void @llvm.memset.p5.i64(ptr addrspace(5) align 8 %agg.result, i8 0, i64 54975581388800, i1 false) 
# | check:20'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            15:  %data = getelementptr inbounds nuw %struct.huge_struct, ptr addrspace(5) %agg.result, i32 0, i32 0 
# | check:20'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            16:  ret void 
# | check:20'0     ~~~~~~~~~~
# |            17: } 
# | check:20'0     ~~
# |            18:  
# | check:20'0     ~
# |            19: ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) 
# | check:20'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            20: declare void @llvm.memset.p5.i64(ptr addrspace(5) writeonly captures(none), i8, i64, i1 immarg) #1 
# | check:20'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            21:  
# | check:20'0     ~
# |            22: ; Function Attrs: convergent mustprogress noinline nounwind optnone 
# | check:20'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            23: define dso_local void @_Z21deviceFuncWithHugeArg11huge_struct(ptr addrspace(5) noundef byref(%struct.huge_struct) align 8 %0) #0 { 
# | check:20'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | check:20'1     ?                                                                                                                                   possible intended match
# |            24: entry: 
# | check:20'0     ~~~~~~~
# |            25:  %coerce = alloca %struct.huge_struct, align 8, addrspace(5) 
# | check:20'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            26:  %X = addrspacecast ptr addrspace(5) %coerce to ptr 
# | check:20'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            27:  call void @llvm.memcpy.p0.p5.i64(ptr align 8 %X, ptr addrspace(5) align 8 %0, i64 54975581388800, i1 false) 
# | check:20'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            28:  ret void 
# | check:20'0     ~~~~~~~~~~
# |             .
# |             .
# |             .
# | >>>>>>
# `-----------------------------
# 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/176921


More information about the cfe-commits mailing list