1 ; RUN: llc -mtriple=amdgcn--amdhsa -mcpu=gfx90a -verify-machineinstrs < %s | FileCheck -check-prefixes=CHECK,GFX90A %s
2 ; RUN: llc -mtriple=amdgcn--amdhsa -mcpu=gfx908 -verify-machineinstrs < %s | FileCheck -check-prefixes=CHECK,GFX908 %s
3 ; RUN: llc -mtriple=amdgcn--amdhsa -mcpu=gfx801 -verify-machineinstrs < %s | FileCheck -check-prefixes=CHECK,GFX801 %s
5 ; COM: Adapted from agpr-register-count.ll
6 ; COM: GFX900 and below should not have .agpr_count present in the metadata
9 ; CHECK: amdhsa.kernels:
11 ; GFX90A: - .agpr_count: 32
12 ; GFX908: - .agpr_count: 32
13 ; GFX801-NOT: - .agpr_count:
14 ; CHECK: .name: kernel_32_agprs
15 ; GFX90A: .vgpr_count: 44
16 ; GFX908: .vgpr_count: 32
17 ; GFX801: .vgpr_count: 9
18 define amdgpu_kernel void @kernel_32_agprs() #0 {
20 call void asm sideeffect "", "~{v8}" ()
21 call void asm sideeffect "", "~{a31}" ()
25 ; GFX90A: - .agpr_count: 0
26 ; GFX908: - .agpr_count: 0
27 ; GFX801-NOT: - .agpr_count:
28 ; CHECK: .name: kernel_0_agprs
29 ; GFX90A: .vgpr_count: 1
30 ; GFX908: .vgpr_count: 1
31 ; GFX801: .vgpr_count: 1
32 define amdgpu_kernel void @kernel_0_agprs() #0 {
34 call void asm sideeffect "", "~{v0}" ()
38 ; GFX90A: - .agpr_count: 16
39 ; GFX908: - .agpr_count: 16
40 ; GFX801-NOT: - .agpr_count:
41 ; CHECK: .name: kernel_40_vgprs
42 ; GFX90A: .vgpr_count: 56
43 ; GFX908: .vgpr_count: 40
44 ; GFX801: .vgpr_count: 40
45 define amdgpu_kernel void @kernel_40_vgprs() #0 {
47 call void asm sideeffect "", "~{v39}" ()
48 call void asm sideeffect "", "~{a15}" ()
52 ; GFX90A: - .agpr_count: 256
53 ; GFX908: - .agpr_count: 256
54 ; GFX801-NOT: - .agpr_count:
55 ; CHECK: .name: kernel_max_gprs
56 ; GFX90A: .vgpr_count: 512
57 ; GFX908: .vgpr_count: 256
58 ; GFX801: .vgpr_count: 256
59 define amdgpu_kernel void @kernel_max_gprs() #0 {
61 call void asm sideeffect "", "~{v255}" ()
62 call void asm sideeffect "", "~{a255}" ()
66 define void @func_32_agprs() #0 {
68 call void asm sideeffect "", "~{v8}" ()
69 call void asm sideeffect "", "~{a31}" ()
73 ; GFX90A: - .agpr_count: 32
74 ; GFX908: - .agpr_count: 32
75 ; GFX801-NOT: - .agpr_count:
76 ; CHECK: .name: kernel_call_func_32_agprs
77 ; GFX90A: .vgpr_count: 44
78 ; GFX908: .vgpr_count: 32
79 ; GFX801: .vgpr_count: 9
80 define amdgpu_kernel void @kernel_call_func_32_agprs() #0 {
82 call void @func_32_agprs() #0
86 declare void @undef_func()
88 ; GFX90A: - .agpr_count: 32
89 ; GFX908: - .agpr_count: 32
90 ; GFX801-NOT: - .agpr_count:
91 ; CHECK: .name: kernel_call_undef_func
92 ; GFX90A: .vgpr_count: 64
93 ; GFX908: .vgpr_count: 32
94 ; GFX801: .vgpr_count: 32
95 define amdgpu_kernel void @kernel_call_undef_func() #0 {
97 call void @undef_func()
101 attributes #0 = { nounwind noinline "amdgpu-flat-work-group-size"="1,512" "amdgpu-no-workitem-id-x" "amdgpu-no-workitem-id-y" "amdgpu-no-workitem-id-z" }