1 ; RUN: llc -mtriple=amdgcn--amdpal -mcpu=gfx90a < %s | FileCheck -check-prefixes=CHECK,GFX90A %s
2 ; RUN: llc -mtriple=amdgcn--amdpal -mcpu=gfx908 < %s | FileCheck -check-prefixes=CHECK,GFX908 %s
4 ; COM: Adapted from agpr-register-count.ll
5 ; COM: GFX900 and below should not have .agpr_count present in the metadata
8 ; CHECK: .type kernel_32_agprs
10 define amdgpu_kernel void @kernel_32_agprs() #0 {
12 call void asm sideeffect "", "~{v8}" ()
13 call void asm sideeffect "", "~{a31}" ()
17 ; CHECK: .type kernel_0_agprs
19 define amdgpu_kernel void @kernel_0_agprs() #0 {
21 call void asm sideeffect "", "~{v0}" ()
25 ; CHECK: .type kernel_40_vgprs
27 define amdgpu_kernel void @kernel_40_vgprs() #0 {
29 call void asm sideeffect "", "~{v39}" ()
30 call void asm sideeffect "", "~{a15}" ()
34 ; CHECK: .type kernel_max_gprs
35 ; CHECK: NumAgprs: 256
36 define amdgpu_kernel void @kernel_max_gprs() #0 {
38 call void asm sideeffect "", "~{v255}" ()
39 call void asm sideeffect "", "~{a255}" ()
43 ; CHECK: .type func_32_agprs
45 define void @func_32_agprs() #0 {
47 call void asm sideeffect "", "~{v8}" ()
48 call void asm sideeffect "", "~{a31}" ()
52 ; CHECK: .type kernel_call_func_32_agprs
54 define amdgpu_kernel void @kernel_call_func_32_agprs() #0 {
56 call void @func_32_agprs() #0
60 declare void @undef_func()
62 ; CHECK: .type kernel_call_undef_func
63 ; CHECK: .set kernel_call_undef_func.num_agpr, max(0, amdgpu.max_num_agpr)
64 ; CHECK: NumAgprs: kernel_call_undef_func.num_agpr
65 ; CHECK: .set amdgpu.max_num_agpr, 32
66 define amdgpu_kernel void @kernel_call_undef_func() #0 {
68 call void @undef_func()
73 ; CHECK: amdpal.pipelines:
74 ; GFX90A: agpr_count: 0x20
75 ; GFX90A: vgpr_count: 0x40
77 ; GFX908: agpr_count: 0x20
78 ; GFX908: vgpr_count: 0x20
80 attributes #0 = { nounwind noinline "amdgpu-flat-work-group-size"="1,512" }