[MachineScheduler] Fix physreg dependencies of ExitSU (#123541)
[llvm-project.git] / llvm / test / CodeGen / AMDGPU / branch-condition-and.ll
blobd23d7a7c8e0c803493ff932098f466ba2b651ce1
1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
2 ; RUN: llc -mtriple=amdgcn -mcpu=tahiti -simplifycfg-require-and-preserve-domtree=1 < %s | FileCheck -check-prefix=GCN %s
3 ; RUN: llc -mtriple=amdgcn -mcpu=tonga -simplifycfg-require-and-preserve-domtree=1 < %s | FileCheck -check-prefix=GCN %s
5 ; This used to crash because during intermediate control flow lowering, there
6 ; was a sequence
7 ;       s_mov_b64 s[0:1], exec
8 ;       s_and_b64 s[2:3], s[0:1], s[2:3] ; def & use of the same register pair
9 ;       ...
10 ;       s_mov_b64_term exec, s[2:3]
11 ; that was not treated correctly.
13 define amdgpu_ps void @ham(float %arg, float %arg1) #0 {
14 ; GCN-LABEL: ham:
15 ; GCN:       ; %bb.0: ; %bb
16 ; GCN-NEXT:    v_cmp_lt_f32_e32 vcc, 0, v0
17 ; GCN-NEXT:    v_cmp_lt_f32_e64 s[0:1], 0, v1
18 ; GCN-NEXT:    s_and_b64 s[0:1], vcc, s[0:1]
19 ; GCN-NEXT:    s_and_saveexec_b64 s[2:3], s[0:1]
20 ; GCN-NEXT:  ; %bb.1: ; %bb4
21 ; GCN-NEXT:    v_mov_b32_e32 v0, 4
22 ; GCN-NEXT:    s_mov_b32 m0, -1
23 ; GCN-NEXT:    ds_write_b32 v0, v0
24 ; GCN-NEXT:    ; divergent unreachable
25 ; GCN-NEXT:  ; %bb.2: ; %UnifiedReturnBlock
26 ; GCN-NEXT:    s_endpgm
27 bb:
28   %tmp = fcmp ogt float %arg, 0.000000e+00
29   %tmp2 = fcmp ogt float %arg1, 0.000000e+00
30   %tmp3 = and i1 %tmp, %tmp2
31   br i1 %tmp3, label %bb4, label %bb5
33 bb4:                                              ; preds = %bb
34   store volatile i32 4, ptr addrspace(3) undef
35   unreachable
37 bb5:                                              ; preds = %bb
38   ret void
41 attributes #0 = { nounwind readonly "InitialPSInputAddr"="36983" }
42 attributes #1 = { nounwind readnone }