• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc -march=amdgcn -mcpu=SI -verify-machineinstrs -asm-verbose < %s | FileCheck -check-prefix=SI %s
2
3declare i32 @llvm.SI.tid() nounwind readnone
4
5; SI-LABEL: {{^}}foo:
6; SI: .section	.AMDGPU.csdata
7; SI: ; Kernel info:
8; SI: ; NumSgprs: {{[0-9]+}}
9; SI: ; NumVgprs: {{[0-9]+}}
10define 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, i32 addrspace(1)* %abase, i32 %tid
13  %bptr = getelementptr i32, i32 addrspace(1)* %bbase, i32 %tid
14  %outptr = getelementptr i32, i32 addrspace(1)* %out, i32 %tid
15  %a = load i32, i32 addrspace(1)* %aptr, align 4
16  %b = load i32, i32 addrspace(1)* %bptr, align 4
17  %result = add i32 %a, %b
18  store i32 %result, i32 addrspace(1)* %outptr, align 4
19  ret void
20}
21
22; SI-LABEL: {{^}}one_vgpr_used:
23; SI: NumVgprs: 1
24define void @one_vgpr_used(i32 addrspace(1)* %out, i32 %x) nounwind {
25  store i32 %x, i32 addrspace(1)* %out, align 4
26  ret void
27}
28