[MachineScheduler] Fix physreg dependencies of ExitSU (#123541)
[llvm-project.git] / llvm / test / CodeGen / AMDGPU / fix-sgpr-copies-f16-fake16.mir
blob5d90bab1384eb877f7e155b79f7f68896c17e746
1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 3
2 # RUN: llc -mtriple=amdgcn -mcpu=gfx1100 -mattr=-real-true16 -run-pass=si-fix-sgpr-copies -verify-machineinstrs -o - %s | FileCheck --check-prefixes=GCN %s
4 # V_CVT_LT_F16 will be replaced with fake16 when its true16/fake16 profile is corrected
6 ---
7 name:            cmp_f16
8 body:             |
9   bb.0.entry:
10     ; GCN-LABEL: name: cmp_f16
11     ; GCN: [[DEF:%[0-9]+]]:vgpr_32 = IMPLICIT_DEF
12     ; GCN-NEXT: [[DEF1:%[0-9]+]]:sreg_32 = IMPLICIT_DEF
13     ; GCN-NEXT: [[V_CVT_F16_U16_fake16_e64_:%[0-9]+]]:vgpr_32 = V_CVT_F16_U16_fake16_e64 [[DEF]], 0, 0, implicit $mode, implicit $exec
14     ; GCN-NEXT: [[DEF2:%[0-9]+]]:sreg_32 = IMPLICIT_DEF
15     ; GCN-NEXT: [[V_CMP_LT_F16_fake16_e64_:%[0-9]+]]:sreg_32_xm0_xexec = nofpexcept V_CMP_LT_F16_fake16_e64 0, [[V_CVT_F16_U16_fake16_e64_]], 0, [[DEF1]], 0, implicit $mode, implicit $exec
16     ; GCN-NEXT: [[V_CNDMASK_B32_e64_:%[0-9]+]]:vgpr_32 = V_CNDMASK_B32_e64 0, 0, 0, -1, killed [[V_CMP_LT_F16_fake16_e64_]], implicit $exec
17     %0:vgpr_32 = IMPLICIT_DEF
18     %1:sreg_32 = IMPLICIT_DEF
19     %2:vgpr_32 = V_CVT_F16_U16_fake16_e64 %0:vgpr_32, 0, 0, implicit $mode, implicit $exec
20     %3:sreg_32 = COPY %2:vgpr_32
21     nofpexcept S_CMP_LT_F16 killed %3:sreg_32, %1:sreg_32, implicit-def $scc, implicit $mode
22     %4:sreg_32_xm0_xexec = COPY $scc
23     %5:vgpr_32 = V_CNDMASK_B32_e64 0, 0, 0, -1, killed %4, implicit $exec
24 ...
26 # Needs extra shift instruction to select hi 16 bits
27 ---
28 name:            cvt_hi_f32_f16
29 body:             |
30   bb.0:
31     ; GCN-LABEL: name: cvt_hi_f32_f16
32     ; GCN: [[DEF:%[0-9]+]]:vgpr_32 = IMPLICIT_DEF
33     ; GCN-NEXT: [[V_CVT_F16_U16_fake16_e64_:%[0-9]+]]:vgpr_32 = V_CVT_F16_U16_fake16_e64 [[DEF]], 0, 0, implicit $mode, implicit $exec
34     ; GCN-NEXT: [[DEF1:%[0-9]+]]:sreg_32 = IMPLICIT_DEF
35     ; GCN-NEXT: [[V_LSHRREV_B32_e64_:%[0-9]+]]:vgpr_32 = V_LSHRREV_B32_e64 16, [[V_CVT_F16_U16_fake16_e64_]], implicit $exec
36     ; GCN-NEXT: [[V_CVT_F32_F16_fake16_e64_:%[0-9]+]]:vgpr_32 = V_CVT_F32_F16_fake16_e64 0, [[V_LSHRREV_B32_e64_]], 0, 0, implicit $mode, implicit $exec
37     %0:vgpr_32 = IMPLICIT_DEF
38     %1:vgpr_32 = V_CVT_F16_U16_fake16_e64 %0:vgpr_32, 0, 0, implicit $mode, implicit $exec
39     %2:sreg_32 = COPY %1:vgpr_32
40     %3:sreg_32 = S_CVT_HI_F32_F16 %2:sreg_32, implicit $mode
41 ...