xref: /llvm-project/llvm/test/CodeGen/AMDGPU/call-alias-register-usage-agpr.ll (revision 4d42e8b5d1fa87e49768d100dd1bc53515391e89)
1; RUN: llc -O0 -mtriple=amdgcn-amd-amdhsa -mcpu=gfx908 < %s | FileCheck -check-prefixes=ALL,GFX908 %s
2; RUN: llc -O0 -mtriple=amdgcn-amd-amdhsa -mcpu=gfx90a < %s | FileCheck -check-prefixes=ALL,GFX90A %s
3
4; CallGraphAnalysis, which CodeGenSCC order depends on, does not look
5; through aliases. If GlobalOpt is never run, we do not see direct
6; calls,
7
8@alias = hidden alias void (), ptr @aliasee_default
9
10; ALL-LABEL: {{^}}kernel:
11; GFX908: .amdhsa_next_free_vgpr 32
12; GFX908-NEXT: .amdhsa_next_free_sgpr 36
13
14; GFX90A: .amdhsa_next_free_vgpr 65
15; GFX90A-NEXT: .amdhsa_next_free_sgpr 36
16; GFX90A-NEXT: .amdhsa_accum_offset 32
17define amdgpu_kernel void @kernel() #0 {
18bb:
19  call void @alias() #2
20  ret void
21}
22
23define internal void @aliasee_default() #1 {
24bb:
25  call void asm sideeffect "; clobber a26 ", "~{a26}"()
26  ret void
27}
28
29attributes #0 = { noinline norecurse nounwind optnone }
30attributes #1 = { noinline norecurse nounwind readnone willreturn }
31attributes #2 = { nounwind readnone willreturn }
32