1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -march=amdgcn -mcpu=gfx1010 -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_setreg_imm32_b32
10 ; CHECK-LABEL: name: need_skip_setreg_imm32_b32
12 ; CHECK-NEXT: successors: %bb.1(0x40000000), %bb.2(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_SETREG_IMM32_B32 3, 2177, implicit-def $mode, implicit $mode
23 ; CHECK-NEXT: S_ENDPGM 0
25 successors: %bb.1, %bb.2
26 S_CBRANCH_EXECZ %bb.2, implicit $exec
30 $vgpr0 = V_MOV_B32_e32 0, implicit $exec
31 S_SETREG_IMM32_B32 3, 2177, implicit-def $mode, implicit $mode
39 name: need_skip_setreg_b32
41 ; CHECK-LABEL: name: need_skip_setreg_b32
43 ; CHECK-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
44 ; CHECK-NEXT: liveins: $sgpr0
46 ; CHECK-NEXT: S_CBRANCH_EXECZ %bb.2, implicit $exec
49 ; CHECK-NEXT: successors: %bb.2(0x80000000)
50 ; CHECK-NEXT: liveins: $sgpr0
52 ; CHECK-NEXT: $vgpr0 = V_MOV_B32_e32 0, implicit $exec
53 ; CHECK-NEXT: S_SETREG_B32 $sgpr0, 3, implicit-def $mode, implicit $mode
56 ; CHECK-NEXT: S_ENDPGM 0
59 successors: %bb.1, %bb.2
60 S_CBRANCH_EXECZ %bb.2, implicit $exec
64 $vgpr0 = V_MOV_B32_e32 0, implicit $exec
65 S_SETREG_B32 $sgpr0, 3, implicit-def $mode, implicit $mode
73 name: need_skip_denorm_mode
75 ; CHECK-LABEL: name: need_skip_denorm_mode
77 ; CHECK-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
79 ; CHECK-NEXT: S_CBRANCH_EXECZ %bb.2, implicit $exec
82 ; CHECK-NEXT: successors: %bb.2(0x80000000)
84 ; CHECK-NEXT: $vgpr0 = V_MOV_B32_e32 0, implicit $exec
85 ; CHECK-NEXT: S_DENORM_MODE 3, implicit-def $mode, implicit $mode
88 ; CHECK-NEXT: S_ENDPGM 0
90 successors: %bb.1, %bb.2
91 S_CBRANCH_EXECZ %bb.2, implicit $exec
94 $vgpr0 = V_MOV_B32_e32 0, implicit $exec
95 S_DENORM_MODE 3, implicit-def $mode, implicit $mode
103 name: need_skip_round_mode
105 ; CHECK-LABEL: name: need_skip_round_mode
107 ; CHECK-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
109 ; CHECK-NEXT: S_CBRANCH_EXECZ %bb.2, implicit $exec
112 ; CHECK-NEXT: successors: %bb.2(0x80000000)
114 ; CHECK-NEXT: $vgpr0 = V_MOV_B32_e32 0, implicit $exec
115 ; CHECK-NEXT: S_ROUND_MODE 3, implicit-def $mode, implicit $mode
118 ; CHECK-NEXT: S_ENDPGM 0
120 successors: %bb.1, %bb.2
121 S_CBRANCH_EXECZ %bb.2, implicit $exec
124 $vgpr0 = V_MOV_B32_e32 0, implicit $exec
125 S_ROUND_MODE 3, implicit-def $mode, implicit $mode
133 name: need_skip_writelane_b32
135 ; CHECK-LABEL: name: need_skip_writelane_b32
137 ; CHECK-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
139 ; CHECK-NEXT: S_CBRANCH_EXECZ %bb.2, implicit $exec
142 ; CHECK-NEXT: successors: %bb.2(0x80000000)
144 ; CHECK-NEXT: $sgpr0 = IMPLICIT_DEF
145 ; CHECK-NEXT: $vgpr0 = V_WRITELANE_B32 $sgpr0, 0, $vgpr0
148 ; CHECK-NEXT: S_ENDPGM 0
150 successors: %bb.1, %bb.2
151 S_CBRANCH_EXECZ %bb.2, implicit $exec
155 $sgpr0 = IMPLICIT_DEF
156 $vgpr0 = V_WRITELANE_B32 $sgpr0, 0, $vgpr0
163 name: need_skip_readlane_b32
165 ; CHECK-LABEL: name: need_skip_readlane_b32
167 ; CHECK-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
169 ; CHECK-NEXT: S_CBRANCH_EXECZ %bb.2, implicit $exec
172 ; CHECK-NEXT: successors: %bb.2(0x80000000)
174 ; CHECK-NEXT: $vgpr0 = IMPLICIT_DEF
175 ; CHECK-NEXT: $sgpr0 = V_READLANE_B32 $vgpr0, 0
178 ; CHECK-NEXT: S_ENDPGM 0
180 successors: %bb.1, %bb.2
181 S_CBRANCH_EXECZ %bb.2, implicit $exec
185 $vgpr0 = IMPLICIT_DEF
186 $sgpr0 = V_READLANE_B32 $vgpr0, 0