1 ; RUN: llc -march=r600 -mcpu=SI < %s | FileCheck -check-prefix=SI %s
3 declare i32 @llvm.SI.tid() nounwind readnone
6 ; SI: .section .AMDGPU.csdata
8 ; SI: ; NumSgprs: {{[0-9]+}}
9 ; SI: ; NumVgprs: {{[0-9]+}}
10 define void @foo(i32 addrspace(1)* noalias %out, i32 addrspace(1)* %abase, i32 addrspace(1)* %bbase) nounwind {
11 %tid = call i32 @llvm.SI.tid() nounwind readnone
12 %aptr = getelementptr i32 addrspace(1)* %abase, i32 %tid
13 %bptr = getelementptr i32 addrspace(1)* %bbase, i32 %tid
14 %outptr = getelementptr i32 addrspace(1)* %out, i32 %tid
15 %a = load i32 addrspace(1)* %aptr, align 4
16 %b = load i32 addrspace(1)* %bptr, align 4
17 %result = add i32 %a, %b
18 store i32 %result, i32 addrspace(1)* %outptr, align 4