[MachineScheduler] Fix physreg dependencies of ExitSU (#123541)
[llvm-project.git] / llvm / test / CodeGen / AMDGPU / si-annotate-cf-unreachable.ll
blob58e3ee143dd20909b6859e83f55dc78d0c459cfb
1 ; RUN: opt -mtriple=amdgcn-- -S -structurizecfg -si-annotate-control-flow %s | FileCheck -check-prefix=OPT %s
2 ; RUN: opt -mtriple=amdgcn-- -S -passes=structurizecfg,si-annotate-control-flow %s | FileCheck -check-prefix=OPT %s
3 ; RUN: llc -mtriple=amdgcn -verify-machineinstrs < %s | FileCheck -check-prefix=GCN %s
6 ; OPT-LABEL: @annotate_unreachable(
7 ; OPT: call { i1, i64 } @llvm.amdgcn.if.i64(
8 ; OPT-NOT: call void @llvm.amdgcn.end.cf
11 ; GCN-LABEL: {{^}}annotate_unreachable:
12 ; GCN: s_and_saveexec_b64
13 ; GCN-NOT: s_endpgm
14 ; GCN: .Lfunc_end0
15 define amdgpu_kernel void @annotate_unreachable(ptr addrspace(1) noalias nocapture readonly %arg, i1 %c0) #0 {
16 bb:
17   %tmp = tail call i32 @llvm.amdgcn.workitem.id.x()
18   br label %bb1
20 bb1:                                              ; preds = %bb
21   %tmp2 = sext i32 %tmp to i64
22   %tmp3 = getelementptr inbounds <4 x float>, ptr addrspace(1) %arg, i64 %tmp2
23   %tmp4 = load <4 x float>, ptr addrspace(1) %tmp3, align 16
24   br i1 %c0, label %bb3, label %bb5  ; label order reversed
26 bb3:                                              ; preds = %bb1
27   %tmp6 = extractelement <4 x float> %tmp4, i32 2
28   %tmp7 = fcmp olt float %tmp6, 0.000000e+00
29   br i1 %tmp7, label %bb4, label %bb5
31 bb4:                                              ; preds = %bb3
32   unreachable
34 bb5:                                              ; preds = %bb3, %bb1
35   unreachable
38 declare i32 @llvm.amdgcn.workitem.id.x() #1
40 attributes #0 = { nounwind }
41 attributes #1 = { nounwind readnone }