1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -march=amdgcn -mcpu=gfx900 -run-pass=si-pre-emit-peephole -amdgpu-skip-threshold=10 -verify-machineinstrs %s -o - | FileCheck %s
3 # Make sure mandatory skips are not removed around mode defs.
4 # FIXME: -amdgpu-skip-threshold seems to be backwards.
8 name: need_skip_gpr_idx_mode
10 ; CHECK-LABEL: name: need_skip_gpr_idx_mode
12 ; CHECK-NEXT: successors: %bb.2(0x40000000), %bb.1(0x40000000)
14 ; CHECK-NEXT: S_CBRANCH_EXECZ %bb.2, implicit $exec
17 ; CHECK-NEXT: successors: %bb.2(0x80000000)
19 ; CHECK-NEXT: $vgpr0 = V_MOV_B32_e32 0, implicit $exec
20 ; CHECK-NEXT: S_SET_GPR_IDX_MODE 0, implicit-def $mode, implicit-def $m0, implicit $mode, implicit $m0
23 ; CHECK-NEXT: S_ENDPGM 0
25 S_CBRANCH_EXECZ %bb.2, implicit $exec
28 $vgpr0 = V_MOV_B32_e32 0, implicit $exec
29 S_SET_GPR_IDX_MODE 0, implicit-def $mode, implicit-def $m0, implicit $mode, implicit $m0
37 name: need_skip_gpr_idx_on
39 ; CHECK-LABEL: name: need_skip_gpr_idx_on
41 ; CHECK-NEXT: successors: %bb.2(0x40000000), %bb.1(0x40000000)
42 ; CHECK-NEXT: liveins: $sgpr0
44 ; CHECK-NEXT: S_CBRANCH_EXECZ %bb.2, implicit $exec
47 ; CHECK-NEXT: successors: %bb.2(0x80000000)
48 ; CHECK-NEXT: liveins: $sgpr0
50 ; CHECK-NEXT: $vgpr0 = V_MOV_B32_e32 0, implicit $exec
51 ; CHECK-NEXT: S_SET_GPR_IDX_ON $sgpr0, 0, implicit-def $mode, implicit-def $m0, implicit $mode, implicit $m0
54 ; CHECK-NEXT: S_ENDPGM 0
57 S_CBRANCH_EXECZ %bb.2, implicit $exec
61 $vgpr0 = V_MOV_B32_e32 0, implicit $exec
62 S_SET_GPR_IDX_ON $sgpr0, 0, implicit-def $mode, implicit-def $m0, implicit $mode, implicit $m0
70 name: need_skip_gpr_idx_off
72 ; CHECK-LABEL: name: need_skip_gpr_idx_off
74 ; CHECK-NEXT: successors: %bb.2(0x40000000), %bb.1(0x40000000)
76 ; CHECK-NEXT: S_CBRANCH_EXECZ %bb.2, implicit $exec
79 ; CHECK-NEXT: successors: %bb.2(0x80000000)
81 ; CHECK-NEXT: $vgpr0 = V_MOV_B32_e32 0, implicit $exec
82 ; CHECK-NEXT: S_SET_GPR_IDX_OFF implicit-def $mode, implicit $mode
85 ; CHECK-NEXT: S_ENDPGM 0
87 S_CBRANCH_EXECZ %bb.2, implicit $exec
90 $vgpr0 = V_MOV_B32_e32 0, implicit $exec
91 S_SET_GPR_IDX_OFF implicit-def $mode, implicit $mode
99 name: need_skip_gpr_idx_idx
101 ; CHECK-LABEL: name: need_skip_gpr_idx_idx
103 ; CHECK-NEXT: successors: %bb.2(0x40000000), %bb.1(0x40000000)
104 ; CHECK-NEXT: liveins: $sgpr0
106 ; CHECK-NEXT: S_CBRANCH_EXECZ %bb.2, implicit $exec
109 ; CHECK-NEXT: successors: %bb.2(0x80000000)
110 ; CHECK-NEXT: liveins: $sgpr0
112 ; CHECK-NEXT: $vgpr0 = V_MOV_B32_e32 0, implicit $exec
113 ; CHECK-NEXT: S_SET_GPR_IDX_IDX $sgpr0, implicit-def $mode, implicit-def $m0, implicit $mode, implicit $m0
116 ; CHECK-NEXT: S_ENDPGM 0
119 S_CBRANCH_EXECZ %bb.2, implicit $exec
123 $vgpr0 = V_MOV_B32_e32 0, implicit $exec
124 S_SET_GPR_IDX_IDX $sgpr0, implicit-def $mode, implicit-def $m0, implicit $mode, implicit $m0