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
12 name: sdwa_opsel_hazard
14 ; CHECK-LABEL: name: sdwa_opsel_hazard
16 ; CHECK-NEXT: successors: %bb.2(0x80000000)
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
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
31 ; CHECK-NEXT: successors: %bb.1(0x80000000)
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
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
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
49 successors: %bb.1(0x40000000)
51 %6:vgpr_32 = V_LSHRREV_B32_e64 16, undef %3, implicit $exec