[MachineScheduler] Fix physreg dependencies of ExitSU (#123541)
[llvm-project.git] / llvm / test / CodeGen / AMDGPU / resource-usage-dead-function.ll
blob5d5aad76afd0958ee2ebdfe5b583e925d3296e8d
1 ; RUN: sed 's/CODE_OBJECT_VERSION/400/g' %s | llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 -o - | FileCheck -check-prefixes=GCN,ALL %s
2 ; RUN: sed 's/CODE_OBJECT_VERSION/500/g' %s | llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 -o - | FileCheck -check-prefixes=GCN-V5,ALL %s
3 ; RUN: sed 's/CODE_OBJECT_VERSION/600/g' %s | llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 -o - | FileCheck -check-prefixes=GCN-V5,ALL %s
5 ; Make sure there's no assertion when trying to report the resource
6 ; usage for a function which becomes dead during codegen.
8 @gv.fptr0 = external hidden unnamed_addr addrspace(4) constant ptr, align 4
10 ; GCN-LABEL: unreachable:
11 ; Function info:
12 ; codeLenInByte = 4
13 define internal fastcc void @unreachable() {
14   %fptr = load ptr, ptr addrspace(4) @gv.fptr0
15   call void %fptr()
16   unreachable
20 ; GCN-LABEL: entry:
21 ; GCN-NOT: s_swappc_b64
22 ; GCN: s_endpgm
24 ; GCN-NOT: .amdhsa_uses_dynamic_stack
25 ; GCN-V5: .amdhsa_uses_dynamic_stack
26 ; ALL: .set entry.private_seg_size, 0
27 ; ALL: .set entry.has_dyn_sized_stack, 0
28 define amdgpu_kernel void @entry() {
29 bb0:
30   br i1 false, label %bb1, label %bb2
32 bb1:
33   tail call fastcc void @unreachable()
34   unreachable
36 bb2:
37   ret void
40 !llvm.module.flags = !{!0}
41 !0 = !{i32 1, !"amdhsa_code_object_version", i32 CODE_OBJECT_VERSION}