1 ; RUN: llc -march=amdgcn -stop-after=amdgpu-isel < %s | FileCheck -enable-var-scope -check-prefixes=GCN,SI %s
\r
2 ; RUN: llc -march=amdgcn -mcpu=gfx900 -stop-after=amdgpu-isel < %s | FileCheck -enable-var-scope -check-prefixes=GCN,GFX900 %s
\r
4 ; FUNC-LABEL: {{^}}uniform_add_SIC:
\r
5 ; GCN: S_SUB_I32 killed %{{[0-9]+}}, 32
\r
6 define amdgpu_kernel void @uniform_add_SIC(i32 addrspace(1)* %out, i32 addrspace(1)* %in) #0 {
\r
7 %a = load i32, i32 addrspace(1)* %in
\r
8 %result = add i32 %a, -32
\r
9 store i32 %result, i32 addrspace(1)* %out
\r
13 ; FUNC-LABEL: {{^}}uniform_add_SIC:
\r
14 ; SI: V_SUB_CO_U32_e64 killed %{{[0-9]+}}, 32
\r
15 ; GFX900: V_SUB_U32_e64 killed %{{[0-9]+}}, 32
\r
16 define amdgpu_kernel void @divergent_add_SIC(i32 addrspace(1)* %out, i32 addrspace(1)* %in) #0 {
\r
17 %tid = call i32 @llvm.amdgcn.workitem.id.x()
\r
18 %gep = getelementptr inbounds i32, i32 addrspace(1)* %in, i32 %tid
\r
19 %a = load volatile i32, i32 addrspace(1)* %gep
\r
20 %result = add i32 %a, -32
\r
21 store i32 %result, i32 addrspace(1)* %out
\r
25 declare i32 @llvm.amdgcn.workitem.id.x() #1
\r
27 attributes #0 = { nounwind }
\r
28 attributes #1 = { nounwind readnone speculatable }
\r