1 ; RUN: llc -O0 -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 < %s | FileCheck %s
3 ; CallGraphAnalysis, which CodeGenSCC order depends on, does not look
4 ; through aliases. If GlobalOpt is never run, we do not see direct
7 @alias1 = hidden alias void (), ptr @aliasee_vgpr32_sgpr76
9 ; The parent kernel has a higher VGPR usage than the possible callees.
11 ; CHECK-LABEL: {{^}}kernel1:
12 ; CHECK: .amdhsa_next_free_vgpr max(totalnumvgprs(kernel1.num_agpr, kernel1.num_vgpr), 1, 0)
13 ; CHECK-NEXT: .amdhsa_next_free_sgpr (max(kernel1.numbered_sgpr+(extrasgprs(kernel1.uses_vcc, kernel1.uses_flat_scratch, 1)), 1, 0))-(extrasgprs(kernel1.uses_vcc, kernel1.uses_flat_scratch, 1))
15 ; CHECK: .set kernel1.num_vgpr, max(42, aliasee_vgpr32_sgpr76.num_vgpr)
16 ; CHECK-NEXT: .set kernel1.num_agpr, max(0, aliasee_vgpr32_sgpr76.num_agpr)
17 ; CHECK-NEXT: .set kernel1.numbered_sgpr, max(33, aliasee_vgpr32_sgpr76.numbered_sgpr)
18 define amdgpu_kernel void @kernel1() #0 {
20 call void asm sideeffect "; clobber v40 ", "~{v40}"()
21 call void @alias1() #2
25 ; CHECK: .set aliasee_vgpr32_sgpr76.num_vgpr, 27
26 ; CHECK-NEXT: .set aliasee_vgpr32_sgpr76.num_agpr, 0
27 ; CHECK-NEXT: .set aliasee_vgpr32_sgpr76.numbered_sgpr, 32
28 define internal void @aliasee_vgpr32_sgpr76() #1 {
30 call void asm sideeffect "; clobber v26 ", "~{v26}"()
34 attributes #0 = { noinline norecurse nounwind optnone }
35 attributes #1 = { noinline norecurse nounwind readnone willreturn "amdgpu-waves-per-eu"="8,10" }
36 attributes #2 = { nounwind readnone willreturn }
38 !llvm.module.flags = !{!0}
39 !0 = !{i32 1, !"amdhsa_code_object_version", i32 500}