1 ; RUN: llc -mtriple=amdgcn--amdhsa -mcpu=gfx908 -verify-machineinstrs < %s | FileCheck -check-prefixes=GCN %s
3 ; GCN-LABEL: {{^}}kernel_32_agprs:
4 ; GCN: .amdhsa_next_free_vgpr 32
7 ; GCN: TotalNumVgprs: 32
9 ; GCN: NumVGPRsForWavesPerEU: 32
11 define amdgpu_kernel void @kernel_32_agprs() {
13 call void asm sideeffect "", "~{v8}" ()
14 call void asm sideeffect "", "~{a31}" ()
18 ; GCN-LABEL: {{^}}kernel_0_agprs:
19 ; GCN: .amdhsa_next_free_vgpr 1
22 ; GCN: TotalNumVgprs: 1
24 ; GCN: NumVGPRsForWavesPerEU: 1
26 define amdgpu_kernel void @kernel_0_agprs() {
28 call void asm sideeffect "", "~{v0}" ()
32 ; GCN-LABEL: {{^}}kernel_40_vgprs:
33 ; GCN: .amdhsa_next_free_vgpr 40
36 ; GCN: TotalNumVgprs: 40
38 ; GCN: NumVGPRsForWavesPerEU: 40
40 define amdgpu_kernel void @kernel_40_vgprs() {
42 call void asm sideeffect "", "~{v39}" ()
43 call void asm sideeffect "", "~{a15}" ()
47 ; GCN-LABEL: {{^}}func_32_agprs:
50 ; GCN: TotalNumVgprs: 32
51 define void @func_32_agprs() #0 {
53 call void asm sideeffect "", "~{v8}" ()
54 call void asm sideeffect "", "~{a31}" ()
58 ; GCN-LABEL: {{^}}func_32_vgprs:
61 ; GCN: TotalNumVgprs: 32
62 define void @func_32_vgprs() {
64 call void asm sideeffect "", "~{v31}" ()
65 call void asm sideeffect "", "~{a8}" ()
69 ; GCN-LABEL: {{^}}func_0_agprs:
72 ; GCN: TotalNumVgprs: 1
73 define amdgpu_kernel void @func_0_agprs() {
75 call void asm sideeffect "", "~{v0}" ()
79 ; GCN-LABEL: {{^}}kernel_max_gprs:
80 ; GCN: .amdhsa_next_free_vgpr 256
83 ; GCN: TotalNumVgprs: 256
85 ; GCN: NumVGPRsForWavesPerEU: 256
87 define amdgpu_kernel void @kernel_max_gprs() {
89 call void asm sideeffect "", "~{v255}" ()
90 call void asm sideeffect "", "~{a255}" ()
94 ; GCN-LABEL: {{^}}kernel_call_func_32_agprs:
95 ; GCN: .amdhsa_next_free_vgpr 32
98 ; GCN: TotalNumVgprs: 32
100 ; GCN: NumVGPRsForWavesPerEU: 32
102 define amdgpu_kernel void @kernel_call_func_32_agprs() {
104 call void @func_32_agprs() #0
108 ; GCN-LABEL: {{^}}func_call_func_32_agprs:
111 ; GCN: TotalNumVgprs: 32
112 define void @func_call_func_32_agprs() {
114 call void @func_32_agprs() #0
118 declare void @undef_func()
120 ; GCN-LABEL: {{^}}kernel_call_undef_func:
121 ; GCN: .amdhsa_next_free_vgpr 24
124 ; GCN: TotalNumVgprs: 24
126 ; GCN: NumVGPRsForWavesPerEU: 24
128 define amdgpu_kernel void @kernel_call_undef_func() {
130 call void @undef_func()
134 attributes #0 = { nounwind noinline }