[MachineScheduler] Fix physreg dependencies of ExitSU (#123541)
[llvm-project.git] / llvm / test / CodeGen / AMDGPU / sdwa-peephole-instr-combine-sel.mir
blobcc2c8b3940d78b00c34d2a18d2070c05101016c6
1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 5
2 # RUN: llc -mtriple=amdgcn -mcpu=gfx1030 -run-pass=si-peephole-sdwa -o - %s | FileCheck -check-prefix=CHECK %s
4 # Currently the conversions in si-peephole-sdwa are disabled on preexisting sdwa instructions.
5 # If they are reenabled, the code matches this pattern instead of the corresponding pattern
6 # for V_LSHLREV_B32_sdwa further below:
7 # [[V_LSHLREV_B32_sdwa:%[0-9]+]]:vgpr_32 = V_LSHLREV_B32_sdwa 0, %{{[0-9]+}}, 0, undef [[GLOBAL_LOAD_DWORD_SADDR]], 0, 6, 0, 6, 5, implicit $exec
9 # TODO Implement a fix for the incorrect sdwa selection
11 ---
12 name:            sdwa_opsel_hazard
13 body:             |
14   ; CHECK-LABEL: name: sdwa_opsel_hazard
15   ; CHECK: bb.0:
16   ; CHECK-NEXT:   successors: %bb.2(0x80000000)
17   ; CHECK-NEXT: {{  $}}
18   ; CHECK-NEXT:   [[DEF:%[0-9]+]]:sreg_32 = IMPLICIT_DEF
19   ; CHECK-NEXT:   [[DEF1:%[0-9]+]]:sreg_64_xexec_xnull = IMPLICIT_DEF
20   ; CHECK-NEXT:   [[DEF2:%[0-9]+]]:vgpr_32 = IMPLICIT_DEF
21   ; CHECK-NEXT:   [[GLOBAL_LOAD_DWORD_SADDR:%[0-9]+]]:vgpr_32 = GLOBAL_LOAD_DWORD_SADDR killed [[DEF1]], [[DEF2]], 0, 0, implicit $exec
22   ; CHECK-NEXT:   S_BRANCH %bb.2
23   ; CHECK-NEXT: {{  $}}
24   ; CHECK-NEXT: bb.1:
25   ; CHECK-NEXT:   [[V_AND_B32_e64_:%[0-9]+]]:vgpr_32 = V_AND_B32_e64 undef %5, 255, implicit $exec
26   ; CHECK-NEXT:   [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 2, implicit $exec
27   ; CHECK-NEXT:   [[V_LSHLREV_B32_sdwa:%[0-9]+]]:vgpr_32 = V_LSHLREV_B32_sdwa 0, [[V_MOV_B32_e32_]], 0, undef %5, 0, 6, 0, 6, 0, implicit $exec
28   ; CHECK-NEXT:   S_ENDPGM 0
29   ; CHECK-NEXT: {{  $}}
30   ; CHECK-NEXT: bb.2:
31   ; CHECK-NEXT:   successors: %bb.1(0x80000000)
32   ; CHECK-NEXT: {{  $}}
33   ; CHECK-NEXT:   [[V_LSHRREV_B32_e64_:%[0-9]+]]:vgpr_32 = V_LSHRREV_B32_e64 16, undef [[GLOBAL_LOAD_DWORD_SADDR]], implicit $exec
34   ; CHECK-NEXT:   S_BRANCH %bb.1
35   bb.0:
36     successors: %bb.2(0x40000000)
37     %0:sreg_32 = IMPLICIT_DEF
38     %1:sreg_64_xexec_xnull = IMPLICIT_DEF
39     %2:vgpr_32 = IMPLICIT_DEF
40     %3:vgpr_32 = GLOBAL_LOAD_DWORD_SADDR killed %1, %2, 0, 0, implicit $exec
41     S_BRANCH %bb.2
43   bb.1:
44     %5:vgpr_32 = V_AND_B32_e64 undef %6, 255, implicit $exec
45     %7:vgpr_32 = V_LSHLREV_B32_e64 2, killed undef %5, implicit $exec
46     S_ENDPGM 0
48   bb.2:
49     successors: %bb.1(0x40000000)
51     %6:vgpr_32 = V_LSHRREV_B32_e64 16, undef %3, implicit $exec
53     S_BRANCH %bb.1
55 ...