1 # RUN: llc -march=amdgcn -mcpu=fiji -run-pass si-insert-skips -verify-machineinstrs -o - %s | FileCheck -check-prefix=GCN %s
2 # RUN: llc -march=amdgcn -mcpu=gfx1010 -run-pass si-insert-skips -verify-machineinstrs -o - %s | FileCheck -check-prefix=W32 %s
5 # GCN-LABEL: name: and_execz_mov_vccz
8 # GCN: S_CBRANCH_EXECZ %bb.1, implicit $exec
9 name: and_execz_mov_vccz
18 $sgpr0_sgpr1 = S_MOV_B64 -1
19 $vcc = S_AND_B64 $exec, killed $sgpr0_sgpr1, implicit-def dead $scc
20 S_CBRANCH_VCCZ %bb.1, implicit killed $vcc
24 # GCN-LABEL: name: and_execz_imm_vccz
26 # GCN: S_CBRANCH_EXECZ %bb.1, implicit $exec
27 name: and_execz_imm_vccz
36 $vcc = S_AND_B64 $exec, -1, implicit-def dead $scc
37 S_CBRANCH_VCCZ %bb.1, implicit killed $vcc
41 # GCN-LABEL: name: and_execnz_imm_vccnz
43 # GCN: S_CBRANCH_EXECNZ %bb.1, implicit $exec
44 name: and_execnz_imm_vccnz
53 $vcc = S_AND_B64 $exec, -1, implicit-def dead $scc
54 S_CBRANCH_VCCNZ %bb.1, implicit killed $vcc
58 # GCN-LABEL: name: and_execz_imm_vccz_live_scc
59 # GCN: $vcc = S_AND_B64 $exec, -1, implicit-def $scc
60 # GCN: S_CBRANCH_EXECZ %bb.1, implicit $exec
61 name: and_execz_imm_vccz_live_scc
70 $vcc = S_AND_B64 $exec, -1, implicit-def $scc
71 S_CBRANCH_VCCZ %bb.1, implicit killed $vcc
75 # GCN-LABEL: name: and_execz_mov_vccz_live_scc
77 # GCN: $vcc = S_AND_B64 $exec, -1, implicit-def $scc
78 # GCN: S_CBRANCH_EXECZ %bb.1, implicit $exec
79 name: and_execz_mov_vccz_live_scc
88 $sgpr0_sgpr1 = S_MOV_B64 -1
89 $vcc = S_AND_B64 $exec, killed $sgpr0_sgpr1, implicit-def $scc
90 S_CBRANCH_VCCZ %bb.1, implicit killed $vcc
94 # GCN-LABEL: name: and_execz_mov_vccz_live_sreg
95 # GCN: $sgpr0_sgpr1 = S_MOV_B64 -1
96 # GCN-NEXT: S_CBRANCH_EXECZ %bb.1, implicit $exec
97 name: and_execz_mov_vccz_live_sreg
106 $sgpr0_sgpr1 = S_MOV_B64 -1
107 $vcc = S_AND_B64 $exec, $sgpr0_sgpr1, implicit-def dead $scc
108 S_CBRANCH_VCCZ %bb.1, implicit killed $vcc
112 # GCN-LABEL: name: and_execz_mov_vccz_live_sreg_commute
113 # GCN: $sgpr0_sgpr1 = S_MOV_B64 -1
114 # GCN-NEXT: S_CBRANCH_EXECZ %bb.1, implicit $exec
115 name: and_execz_mov_vccz_live_sreg_commute
124 $sgpr0_sgpr1 = S_MOV_B64 -1
125 $vcc = S_AND_B64 $sgpr0_sgpr1, $exec, implicit-def dead $scc
126 S_CBRANCH_VCCZ %bb.1, implicit killed $vcc
130 # GCN-LABEL: name: and_execz_mov_vccz_live_scc_commute
132 # GCN: $vcc = S_AND_B64 $exec, -1, implicit-def $scc
133 # GCN: S_CBRANCH_EXECZ %bb.1, implicit $exec
134 name: and_execz_mov_vccz_live_scc_commute
143 $sgpr0_sgpr1 = S_MOV_B64 -1
144 $vcc = S_AND_B64 killed $sgpr0_sgpr1, $exec, implicit-def $scc
145 S_CBRANCH_VCCZ %bb.1, implicit killed $vcc
149 # GCN-LABEL: name: and_execz_mov_vccz_commute
152 # GCN: S_CBRANCH_EXECZ %bb.1, implicit $exec
153 name: and_execz_mov_vccz_commute
162 $sgpr0_sgpr1 = S_MOV_B64 -1
163 $vcc = S_AND_B64 killed $sgpr0_sgpr1, $exec, implicit-def dead $scc
164 S_CBRANCH_VCCZ %bb.1, implicit killed $vcc
168 # GCN-LABEL: name: and_execz_mov_exec_vccz
169 # GCN: $exec = S_MOV_B64 -1
170 # GCN-NEXT: S_ENDPGM 0
171 name: and_execz_mov_exec_vccz
181 $vcc = S_AND_B64 $exec, $exec, implicit-def dead $scc
182 S_CBRANCH_VCCZ %bb.1, implicit killed $vcc
186 # GCN-LABEL: name: and_execz_mov_exec_vccnz
187 # GCN: $exec = S_MOV_B64 -1
188 # GCN-NEXT: S_BRANCH %bb.1{{$}}
189 name: and_execz_mov_exec_vccnz
199 $vcc = S_AND_B64 $exec, $exec, implicit-def dead $scc
200 S_CBRANCH_VCCNZ %bb.1, implicit killed $vcc
204 # GCN-LABEL: name: and_execz_mov_vccz_reads_sreg_early
205 # GCN: $sgpr0_sgpr1 = S_MOV_B64 -1
206 # GCN-NEXT: $sgpr2 = S_MOV_B32 $sgpr1
207 # GCN-NEXT: S_CBRANCH_EXECZ %bb.1, implicit $exec
208 name: and_execz_mov_vccz_reads_sreg_early
217 $sgpr0_sgpr1 = S_MOV_B64 -1
218 $sgpr2 = S_MOV_B32 $sgpr1
219 $vcc = S_AND_B64 $exec, killed $sgpr0_sgpr1, implicit-def dead $scc
220 S_CBRANCH_VCCZ %bb.1, implicit killed $vcc
224 # GCN-LABEL: name: and_execz_mov_vccz_reads_sreg_late
225 # GCN: $sgpr0_sgpr1 = S_MOV_B64 -1
226 # GCN-NEXT: $sgpr2 = S_MOV_B32 $sgpr1
227 # GCN-NEXT: S_CBRANCH_EXECZ %bb.1, implicit $exec
228 name: and_execz_mov_vccz_reads_sreg_late
237 $sgpr0_sgpr1 = S_MOV_B64 -1
238 $vcc = S_AND_B64 $exec, $sgpr0_sgpr1, implicit-def dead $scc
239 $sgpr2 = S_MOV_B32 $sgpr1
240 S_CBRANCH_VCCZ %bb.1, implicit killed $vcc
243 # GCN-LABEL: name: and_execz_mov_vccz_reads_writes_sreg_early
244 # GCN: $sgpr0_sgpr1 = S_MOV_B64 -1
245 # GCN-NEXT: $sgpr1 = S_MOV_B32 $sgpr0
246 # GCN-NEXT: $vcc = S_AND_B64 $exec, killed $sgpr0_sgpr1, implicit-def dead $scc
247 # GCN-NEXT: S_CBRANCH_VCCZ %bb.1, implicit killed $vcc
248 name: and_execz_mov_vccz_reads_writes_sreg_early
257 $sgpr0_sgpr1 = S_MOV_B64 -1
258 $sgpr1 = S_MOV_B32 $sgpr0
259 $vcc = S_AND_B64 $exec, killed $sgpr0_sgpr1, implicit-def dead $scc
260 S_CBRANCH_VCCZ %bb.1, implicit killed $vcc
264 # GCN-LABEL: name: and_execz_mov_vccz_reads_cond
265 # GCN: $vcc = S_AND_B64 $exec, -1, implicit-def dead $scc
266 # GCN-NEXT: $sgpr2 = S_MOV_B32 $vcc_lo
267 # GCN-NEXT: S_CBRANCH_EXECZ %bb.1, implicit $exec
268 name: and_execz_mov_vccz_reads_cond
277 $sgpr0_sgpr1 = S_MOV_B64 -1
278 $vcc = S_AND_B64 $exec, killed $sgpr0_sgpr1, implicit-def dead $scc
279 $sgpr2 = S_MOV_B32 $vcc_lo
280 S_CBRANCH_VCCZ %bb.1, implicit killed $vcc
284 # GCN-LABEL: name: and_execz_mov_vccz_modifies_sreg
285 # GCN: $sgpr0_sgpr1 = S_MOV_B64 -1
286 # GCN-NEXT: $sgpr0 = S_MOV_B32 0
287 # GCN-NEXT: $vcc = S_AND_B64 $exec, killed $sgpr0_sgpr1, implicit-def dead $scc
288 # GCN-NEXT: S_CBRANCH_VCCZ %bb.1, implicit killed $vcc
289 name: and_execz_mov_vccz_modifies_sreg
298 $sgpr0_sgpr1 = S_MOV_B64 -1
300 $vcc = S_AND_B64 $exec, killed $sgpr0_sgpr1, implicit-def dead $scc
301 S_CBRANCH_VCCZ %bb.1, implicit killed $vcc
305 # GCN-LABEL: name: and_execz_imm_vccz_liveout_scc
306 # GCN: $vcc = S_AND_B64 $exec, -1, implicit-def $scc
307 # GCN-NEXT: S_CBRANCH_EXECZ %bb.1, implicit $exec
308 # GCN-NEXT S_ENDPGM 0, implicit $scc
309 name: and_execz_imm_vccz_liveout_scc
318 $vcc = S_AND_B64 $exec, -1, implicit-def $scc
319 S_CBRANCH_VCCZ %bb.1, implicit killed $vcc
320 S_ENDPGM 0, implicit $scc
323 # W32-LABEL: name: and_execz_mov_vccz_w32
326 # W32: S_CBRANCH_EXECZ %bb.1, implicit $exec
327 name: and_execz_mov_vccz_w32
336 $sgpr0 = S_MOV_B32 -1
337 $vcc_lo = S_AND_B32 $exec_lo, killed $sgpr0, implicit-def dead $scc
338 S_CBRANCH_VCCZ %bb.1, implicit killed $vcc