1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=amdgcn-mesa-mesa3d -mcpu=fiji -O0 -run-pass=legalizer -verify-machineinstrs %s -o - | FileCheck -check-prefix=WAVE64 %s
3 # RUN: llc -mtriple=amdgcn-mesa-mesa3d -mcpu=gfx1010 -mattr=+wavefrontsize32,-wavefrontsize64 -O0 -run-pass=legalizer -verify-machineinstrs %s -o - | FileCheck -check-prefix=WAVE32 %s
4 # RUN: llc -mtriple=amdgcn-mesa-mesa3d -mcpu=gfx1100 -mattr=+wavefrontsize32,-wavefrontsize64 -O0 -run-pass=legalizer -verify-machineinstrs %s -o - | FileCheck -check-prefix=WAVE32 %s
9 ; WAVE64-LABEL: name: legal_brcond_vcc
11 ; WAVE64-NEXT: successors: %bb.1(0x80000000)
12 ; WAVE64-NEXT: liveins: $vgpr0, $vgpr1
14 ; WAVE64-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
15 ; WAVE64-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
16 ; WAVE64-NEXT: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[COPY]](s32), [[COPY1]]
17 ; WAVE64-NEXT: G_BRCOND [[ICMP]](s1), %bb.1
20 ; WAVE32-LABEL: name: legal_brcond_vcc
22 ; WAVE32-NEXT: successors: %bb.1(0x80000000)
23 ; WAVE32-NEXT: liveins: $vgpr0, $vgpr1
25 ; WAVE32-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
26 ; WAVE32-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
27 ; WAVE32-NEXT: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[COPY]](s32), [[COPY1]]
28 ; WAVE32-NEXT: G_BRCOND [[ICMP]](s1), %bb.1
33 liveins: $vgpr0, $vgpr1
34 %0:_(s32) = COPY $vgpr0
35 %1:_(s32) = COPY $vgpr1
36 %2:_(s1) = G_ICMP intpred(ne), %0, %1
44 name: legal_brcond_sgpr_s1
47 ; WAVE64-LABEL: name: legal_brcond_sgpr_s1
49 ; WAVE64-NEXT: successors: %bb.1(0x80000000)
50 ; WAVE64-NEXT: liveins: $sgpr0, $sgpr1
52 ; WAVE64-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $sgpr0
53 ; WAVE64-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $sgpr1
54 ; WAVE64-NEXT: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY]](s32), [[COPY1]]
55 ; WAVE64-NEXT: G_BRCOND [[ICMP]](s1), %bb.1
58 ; WAVE32-LABEL: name: legal_brcond_sgpr_s1
60 ; WAVE32-NEXT: successors: %bb.1(0x80000000)
61 ; WAVE32-NEXT: liveins: $sgpr0, $sgpr1
63 ; WAVE32-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $sgpr0
64 ; WAVE32-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $sgpr1
65 ; WAVE32-NEXT: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY]](s32), [[COPY1]]
66 ; WAVE32-NEXT: G_BRCOND [[ICMP]](s1), %bb.1
70 liveins: $sgpr0, $sgpr1
72 %0:_(s32) = COPY $sgpr0
73 %1:_(s32) = COPY $sgpr1
74 %2:_(s1) = G_ICMP intpred(eq), %0, %1
83 name: legal_brcond_sgpr_s32
86 ; WAVE64-LABEL: name: legal_brcond_sgpr_s32
88 ; WAVE64-NEXT: successors: %bb.1(0x80000000)
89 ; WAVE64-NEXT: liveins: $sgpr0, $sgpr1
91 ; WAVE64-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $sgpr0
92 ; WAVE64-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $sgpr1
93 ; WAVE64-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), [[COPY]](s32), [[COPY1]]
94 ; WAVE64-NEXT: G_BRCOND [[ICMP]](s32), %bb.1
97 ; WAVE32-LABEL: name: legal_brcond_sgpr_s32
99 ; WAVE32-NEXT: successors: %bb.1(0x80000000)
100 ; WAVE32-NEXT: liveins: $sgpr0, $sgpr1
101 ; WAVE32-NEXT: {{ $}}
102 ; WAVE32-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $sgpr0
103 ; WAVE32-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $sgpr1
104 ; WAVE32-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), [[COPY]](s32), [[COPY1]]
105 ; WAVE32-NEXT: G_BRCOND [[ICMP]](s32), %bb.1
106 ; WAVE32-NEXT: {{ $}}
109 liveins: $sgpr0, $sgpr1
111 %0:_(s32) = COPY $sgpr0
112 %1:_(s32) = COPY $sgpr1
113 %2:_(s32) = G_ICMP intpred(eq), %0, %1
123 ; WAVE64-LABEL: name: brcond_si_if
125 ; WAVE64-NEXT: successors: %bb.1(0x80000000)
126 ; WAVE64-NEXT: liveins: $vgpr0, $vgpr1
127 ; WAVE64-NEXT: {{ $}}
128 ; WAVE64-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
129 ; WAVE64-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
130 ; WAVE64-NEXT: [[ICMP:%[0-9]+]]:sreg_64_xexec(s1) = G_ICMP intpred(ne), [[COPY]](s32), [[COPY1]]
131 ; WAVE64-NEXT: [[SI_IF:%[0-9]+]]:sreg_64_xexec(s64) = SI_IF [[ICMP]](s1), %bb.1, implicit-def $exec, implicit-def $scc, implicit $exec
132 ; WAVE64-NEXT: G_BR %bb.1
133 ; WAVE64-NEXT: {{ $}}
135 ; WAVE32-LABEL: name: brcond_si_if
137 ; WAVE32-NEXT: successors: %bb.1(0x80000000)
138 ; WAVE32-NEXT: liveins: $vgpr0, $vgpr1
139 ; WAVE32-NEXT: {{ $}}
140 ; WAVE32-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
141 ; WAVE32-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
142 ; WAVE32-NEXT: [[ICMP:%[0-9]+]]:sreg_32_xm0_xexec(s1) = G_ICMP intpred(ne), [[COPY]](s32), [[COPY1]]
143 ; WAVE32-NEXT: [[SI_IF:%[0-9]+]]:sreg_32_xm0_xexec(s64) = SI_IF [[ICMP]](s1), %bb.1, implicit-def $exec, implicit-def $scc, implicit $exec
144 ; WAVE32-NEXT: G_BR %bb.1
145 ; WAVE32-NEXT: {{ $}}
149 liveins: $vgpr0, $vgpr1
150 %0:_(s32) = COPY $vgpr0
151 %1:_(s32) = COPY $vgpr1
152 %2:_(s1) = G_ICMP intpred(ne), %0, %1
153 %3:_(s1), %4:_(s64) = G_INTRINSIC_W_SIDE_EFFECTS intrinsic(@llvm.amdgcn.if), %2
162 ; WAVE64-LABEL: name: brcond_si_else
164 ; WAVE64-NEXT: successors: %bb.1(0x80000000)
165 ; WAVE64-NEXT: liveins: $vgpr0, $vgpr1
166 ; WAVE64-NEXT: {{ $}}
167 ; WAVE64-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
168 ; WAVE64-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
169 ; WAVE64-NEXT: [[ICMP:%[0-9]+]]:sreg_64_xexec(s1) = G_ICMP intpred(ne), [[COPY]](s32), [[COPY1]]
170 ; WAVE64-NEXT: [[SI_ELSE:%[0-9]+]]:sreg_64_xexec(s64) = SI_ELSE [[ICMP]](s1), %bb.1, implicit-def $exec, implicit-def $scc, implicit $exec
171 ; WAVE64-NEXT: G_BR %bb.1
172 ; WAVE64-NEXT: {{ $}}
174 ; WAVE32-LABEL: name: brcond_si_else
176 ; WAVE32-NEXT: successors: %bb.1(0x80000000)
177 ; WAVE32-NEXT: liveins: $vgpr0, $vgpr1
178 ; WAVE32-NEXT: {{ $}}
179 ; WAVE32-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
180 ; WAVE32-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
181 ; WAVE32-NEXT: [[ICMP:%[0-9]+]]:sreg_32_xm0_xexec(s1) = G_ICMP intpred(ne), [[COPY]](s32), [[COPY1]]
182 ; WAVE32-NEXT: [[SI_ELSE:%[0-9]+]]:sreg_32_xm0_xexec(s64) = SI_ELSE [[ICMP]](s1), %bb.1, implicit-def $exec, implicit-def $scc, implicit $exec
183 ; WAVE32-NEXT: G_BR %bb.1
184 ; WAVE32-NEXT: {{ $}}
188 liveins: $vgpr0, $vgpr1
189 %0:_(s32) = COPY $vgpr0
190 %1:_(s32) = COPY $vgpr1
191 %2:_(s1) = G_ICMP intpred(ne), %0, %1
192 %3:_(s1), %4:_(s64) = G_INTRINSIC_W_SIDE_EFFECTS intrinsic(@llvm.amdgcn.else), %2
199 name: brcond_si_loop_brcond
200 tracksRegLiveness: true
202 ; WAVE64-LABEL: name: brcond_si_loop_brcond
204 ; WAVE64-NEXT: successors: %bb.1(0x80000000)
205 ; WAVE64-NEXT: liveins: $vgpr0, $vgpr1, $sgpr0_sgpr1
206 ; WAVE64-NEXT: {{ $}}
207 ; WAVE64-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
208 ; WAVE64-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
209 ; WAVE64-NEXT: [[COPY2:%[0-9]+]]:sreg_64_xexec(s64) = COPY $sgpr0_sgpr1
210 ; WAVE64-NEXT: {{ $}}
212 ; WAVE64-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
213 ; WAVE64-NEXT: {{ $}}
214 ; WAVE64-NEXT: S_NOP 0
215 ; WAVE64-NEXT: SI_LOOP [[COPY2]](s64), %bb.1, implicit-def $exec, implicit-def $scc, implicit $exec
216 ; WAVE64-NEXT: G_BR %bb.2
217 ; WAVE64-NEXT: {{ $}}
219 ; WAVE64-NEXT: S_NOP 0
220 ; WAVE32-LABEL: name: brcond_si_loop_brcond
222 ; WAVE32-NEXT: successors: %bb.1(0x80000000)
223 ; WAVE32-NEXT: liveins: $vgpr0, $vgpr1, $sgpr0_sgpr1
224 ; WAVE32-NEXT: {{ $}}
225 ; WAVE32-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
226 ; WAVE32-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
227 ; WAVE32-NEXT: [[COPY2:%[0-9]+]]:sreg_32_xm0_xexec(s64) = COPY $sgpr0_sgpr1
228 ; WAVE32-NEXT: {{ $}}
230 ; WAVE32-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
231 ; WAVE32-NEXT: {{ $}}
232 ; WAVE32-NEXT: S_NOP 0
233 ; WAVE32-NEXT: SI_LOOP [[COPY2]](s64), %bb.1, implicit-def $exec, implicit-def $scc, implicit $exec
234 ; WAVE32-NEXT: G_BR %bb.2
235 ; WAVE32-NEXT: {{ $}}
237 ; WAVE32-NEXT: S_NOP 0
239 liveins: $vgpr0, $vgpr1, $sgpr0_sgpr1
240 %0:_(s32) = COPY $vgpr0
241 %1:_(s32) = COPY $vgpr1
242 %2:_(s64) = COPY $sgpr0_sgpr1
245 successors: %bb.1, %bb.2
247 %3:_(s1) = G_INTRINSIC_W_SIDE_EFFECTS intrinsic(@llvm.amdgcn.loop), %2
255 # This usage is backwards from how the intrinsic is supposed to be
258 name: brcond_si_loop_brcond_back
259 tracksRegLiveness: true
261 ; WAVE64-LABEL: name: brcond_si_loop_brcond_back
263 ; WAVE64-NEXT: successors: %bb.1(0x80000000)
264 ; WAVE64-NEXT: liveins: $vgpr0, $vgpr1, $sgpr0_sgpr1
265 ; WAVE64-NEXT: {{ $}}
266 ; WAVE64-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
267 ; WAVE64-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
268 ; WAVE64-NEXT: [[COPY2:%[0-9]+]]:sreg_64_xexec(s64) = COPY $sgpr0_sgpr1
269 ; WAVE64-NEXT: {{ $}}
271 ; WAVE64-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
272 ; WAVE64-NEXT: {{ $}}
273 ; WAVE64-NEXT: S_NOP 0
274 ; WAVE64-NEXT: SI_LOOP [[COPY2]](s64), %bb.2, implicit-def $exec, implicit-def $scc, implicit $exec
275 ; WAVE64-NEXT: G_BR %bb.1
276 ; WAVE64-NEXT: {{ $}}
278 ; WAVE64-NEXT: S_NOP 0
279 ; WAVE32-LABEL: name: brcond_si_loop_brcond_back
281 ; WAVE32-NEXT: successors: %bb.1(0x80000000)
282 ; WAVE32-NEXT: liveins: $vgpr0, $vgpr1, $sgpr0_sgpr1
283 ; WAVE32-NEXT: {{ $}}
284 ; WAVE32-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
285 ; WAVE32-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
286 ; WAVE32-NEXT: [[COPY2:%[0-9]+]]:sreg_32_xm0_xexec(s64) = COPY $sgpr0_sgpr1
287 ; WAVE32-NEXT: {{ $}}
289 ; WAVE32-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
290 ; WAVE32-NEXT: {{ $}}
291 ; WAVE32-NEXT: S_NOP 0
292 ; WAVE32-NEXT: SI_LOOP [[COPY2]](s64), %bb.2, implicit-def $exec, implicit-def $scc, implicit $exec
293 ; WAVE32-NEXT: G_BR %bb.1
294 ; WAVE32-NEXT: {{ $}}
296 ; WAVE32-NEXT: S_NOP 0
298 liveins: $vgpr0, $vgpr1, $sgpr0_sgpr1
299 %0:_(s32) = COPY $vgpr0
300 %1:_(s32) = COPY $vgpr1
301 %2:_(s64) = COPY $sgpr0_sgpr1
304 successors: %bb.1, %bb.2
306 %3:_(s1) = G_INTRINSIC_W_SIDE_EFFECTS intrinsic(@llvm.amdgcn.loop), %2
314 # This usage is backwards from how the intrinsic is supposed to be
317 name: brcond_si_loop_brcond_back_fallthrough
318 tracksRegLiveness: true
320 ; WAVE64-LABEL: name: brcond_si_loop_brcond_back_fallthrough
322 ; WAVE64-NEXT: successors: %bb.1(0x80000000)
323 ; WAVE64-NEXT: liveins: $vgpr0, $vgpr1, $sgpr0_sgpr1
324 ; WAVE64-NEXT: {{ $}}
325 ; WAVE64-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
326 ; WAVE64-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
327 ; WAVE64-NEXT: [[COPY2:%[0-9]+]]:sreg_64_xexec(s64) = COPY $sgpr0_sgpr1
328 ; WAVE64-NEXT: {{ $}}
330 ; WAVE64-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
331 ; WAVE64-NEXT: {{ $}}
332 ; WAVE64-NEXT: S_NOP 0
333 ; WAVE64-NEXT: SI_LOOP [[COPY2]](s64), %bb.2, implicit-def $exec, implicit-def $scc, implicit $exec
334 ; WAVE64-NEXT: G_BR %bb.1
335 ; WAVE64-NEXT: {{ $}}
337 ; WAVE32-LABEL: name: brcond_si_loop_brcond_back_fallthrough
339 ; WAVE32-NEXT: successors: %bb.1(0x80000000)
340 ; WAVE32-NEXT: liveins: $vgpr0, $vgpr1, $sgpr0_sgpr1
341 ; WAVE32-NEXT: {{ $}}
342 ; WAVE32-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
343 ; WAVE32-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
344 ; WAVE32-NEXT: [[COPY2:%[0-9]+]]:sreg_32_xm0_xexec(s64) = COPY $sgpr0_sgpr1
345 ; WAVE32-NEXT: {{ $}}
347 ; WAVE32-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
348 ; WAVE32-NEXT: {{ $}}
349 ; WAVE32-NEXT: S_NOP 0
350 ; WAVE32-NEXT: SI_LOOP [[COPY2]](s64), %bb.2, implicit-def $exec, implicit-def $scc, implicit $exec
351 ; WAVE32-NEXT: G_BR %bb.1
352 ; WAVE32-NEXT: {{ $}}
355 liveins: $vgpr0, $vgpr1, $sgpr0_sgpr1
356 %0:_(s32) = COPY $vgpr0
357 %1:_(s32) = COPY $vgpr1
358 %2:_(s64) = COPY $sgpr0_sgpr1
361 successors: %bb.1, %bb.2
363 %3:_(s1) = G_INTRINSIC_W_SIDE_EFFECTS intrinsic(@llvm.amdgcn.loop), %2
369 # There's another instruction between the intrinsic and the
370 # conditional branch, so we need to move the insert point.
372 name: brcond_si_if_need_insert_terminator_point
374 ; WAVE64-LABEL: name: brcond_si_if_need_insert_terminator_point
376 ; WAVE64-NEXT: successors: %bb.1(0x80000000)
377 ; WAVE64-NEXT: liveins: $vgpr0, $vgpr1, $vgpr2
378 ; WAVE64-NEXT: {{ $}}
379 ; WAVE64-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
380 ; WAVE64-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
381 ; WAVE64-NEXT: [[ICMP:%[0-9]+]]:sreg_64_xexec(s1) = G_ICMP intpred(ne), [[COPY]](s32), [[COPY1]]
382 ; WAVE64-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY $vgpr2
383 ; WAVE64-NEXT: [[SI_IF:%[0-9]+]]:sreg_64_xexec(s64) = SI_IF [[ICMP]](s1), %bb.1, implicit-def $exec, implicit-def $scc, implicit $exec
384 ; WAVE64-NEXT: G_BR %bb.1
385 ; WAVE64-NEXT: {{ $}}
387 ; WAVE64-NEXT: S_ENDPGM 0, implicit [[COPY2]](s32)
388 ; WAVE32-LABEL: name: brcond_si_if_need_insert_terminator_point
390 ; WAVE32-NEXT: successors: %bb.1(0x80000000)
391 ; WAVE32-NEXT: liveins: $vgpr0, $vgpr1, $vgpr2
392 ; WAVE32-NEXT: {{ $}}
393 ; WAVE32-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
394 ; WAVE32-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
395 ; WAVE32-NEXT: [[ICMP:%[0-9]+]]:sreg_32_xm0_xexec(s1) = G_ICMP intpred(ne), [[COPY]](s32), [[COPY1]]
396 ; WAVE32-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY $vgpr2
397 ; WAVE32-NEXT: [[SI_IF:%[0-9]+]]:sreg_32_xm0_xexec(s64) = SI_IF [[ICMP]](s1), %bb.1, implicit-def $exec, implicit-def $scc, implicit $exec
398 ; WAVE32-NEXT: G_BR %bb.1
399 ; WAVE32-NEXT: {{ $}}
401 ; WAVE32-NEXT: S_ENDPGM 0, implicit [[COPY2]](s32)
404 liveins: $vgpr0, $vgpr1, $vgpr2
405 %0:_(s32) = COPY $vgpr0
406 %1:_(s32) = COPY $vgpr1
407 %2:_(s1) = G_ICMP intpred(ne), %0, %1
408 %3:_(s1), %4:_(s64) = G_INTRINSIC_W_SIDE_EFFECTS intrinsic(@llvm.amdgcn.if), %2
409 %5:_(s32) = COPY $vgpr2
413 S_ENDPGM 0, implicit %5
417 name: brcond_si_loop_need_terminator_insert_point
418 tracksRegLiveness: true
420 ; WAVE64-LABEL: name: brcond_si_loop_need_terminator_insert_point
422 ; WAVE64-NEXT: successors: %bb.1(0x80000000)
423 ; WAVE64-NEXT: liveins: $vgpr0, $vgpr1, $sgpr0_sgpr1
424 ; WAVE64-NEXT: {{ $}}
425 ; WAVE64-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
426 ; WAVE64-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
427 ; WAVE64-NEXT: [[COPY2:%[0-9]+]]:sreg_64_xexec(s64) = COPY $sgpr0_sgpr1
428 ; WAVE64-NEXT: {{ $}}
430 ; WAVE64-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
431 ; WAVE64-NEXT: {{ $}}
432 ; WAVE64-NEXT: S_NOP 0
433 ; WAVE64-NEXT: S_NOP 0
434 ; WAVE64-NEXT: S_NOP 0
435 ; WAVE64-NEXT: SI_LOOP [[COPY2]](s64), %bb.1, implicit-def $exec, implicit-def $scc, implicit $exec
436 ; WAVE64-NEXT: G_BR %bb.2
437 ; WAVE64-NEXT: {{ $}}
439 ; WAVE64-NEXT: S_NOP 0
440 ; WAVE32-LABEL: name: brcond_si_loop_need_terminator_insert_point
442 ; WAVE32-NEXT: successors: %bb.1(0x80000000)
443 ; WAVE32-NEXT: liveins: $vgpr0, $vgpr1, $sgpr0_sgpr1
444 ; WAVE32-NEXT: {{ $}}
445 ; WAVE32-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
446 ; WAVE32-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
447 ; WAVE32-NEXT: [[COPY2:%[0-9]+]]:sreg_32_xm0_xexec(s64) = COPY $sgpr0_sgpr1
448 ; WAVE32-NEXT: {{ $}}
450 ; WAVE32-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
451 ; WAVE32-NEXT: {{ $}}
452 ; WAVE32-NEXT: S_NOP 0
453 ; WAVE32-NEXT: S_NOP 0
454 ; WAVE32-NEXT: S_NOP 0
455 ; WAVE32-NEXT: SI_LOOP [[COPY2]](s64), %bb.1, implicit-def $exec, implicit-def $scc, implicit $exec
456 ; WAVE32-NEXT: G_BR %bb.2
457 ; WAVE32-NEXT: {{ $}}
459 ; WAVE32-NEXT: S_NOP 0
461 liveins: $vgpr0, $vgpr1, $sgpr0_sgpr1
462 %0:_(s32) = COPY $vgpr0
463 %1:_(s32) = COPY $vgpr1
464 %2:_(s64) = COPY $sgpr0_sgpr1
467 successors: %bb.1, %bb.2
469 %3:_(s1) = G_INTRINSIC_W_SIDE_EFFECTS intrinsic(@llvm.amdgcn.loop), %2
480 name: brcond_si_if_negated
482 ; WAVE64-LABEL: name: brcond_si_if_negated
484 ; WAVE64-NEXT: successors: %bb.1(0x80000000)
485 ; WAVE64-NEXT: liveins: $vgpr0, $vgpr1
486 ; WAVE64-NEXT: {{ $}}
487 ; WAVE64-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
488 ; WAVE64-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
489 ; WAVE64-NEXT: [[ICMP:%[0-9]+]]:sreg_64_xexec(s1) = G_ICMP intpred(ne), [[COPY]](s32), [[COPY1]]
490 ; WAVE64-NEXT: [[SI_IF:%[0-9]+]]:sreg_64_xexec(s64) = SI_IF [[ICMP]](s1), %bb.2, implicit-def $exec, implicit-def $scc, implicit $exec
491 ; WAVE64-NEXT: G_BR %bb.1
492 ; WAVE64-NEXT: {{ $}}
494 ; WAVE64-NEXT: successors: %bb.2(0x80000000)
495 ; WAVE64-NEXT: {{ $}}
496 ; WAVE64-NEXT: S_NOP 0
497 ; WAVE64-NEXT: {{ $}}
499 ; WAVE64-NEXT: S_NOP 1
500 ; WAVE32-LABEL: name: brcond_si_if_negated
502 ; WAVE32-NEXT: successors: %bb.1(0x80000000)
503 ; WAVE32-NEXT: liveins: $vgpr0, $vgpr1
504 ; WAVE32-NEXT: {{ $}}
505 ; WAVE32-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
506 ; WAVE32-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
507 ; WAVE32-NEXT: [[ICMP:%[0-9]+]]:sreg_32_xm0_xexec(s1) = G_ICMP intpred(ne), [[COPY]](s32), [[COPY1]]
508 ; WAVE32-NEXT: [[SI_IF:%[0-9]+]]:sreg_32_xm0_xexec(s64) = SI_IF [[ICMP]](s1), %bb.2, implicit-def $exec, implicit-def $scc, implicit $exec
509 ; WAVE32-NEXT: G_BR %bb.1
510 ; WAVE32-NEXT: {{ $}}
512 ; WAVE32-NEXT: successors: %bb.2(0x80000000)
513 ; WAVE32-NEXT: {{ $}}
514 ; WAVE32-NEXT: S_NOP 0
515 ; WAVE32-NEXT: {{ $}}
517 ; WAVE32-NEXT: S_NOP 1
520 liveins: $vgpr0, $vgpr1
521 %0:_(s32) = COPY $vgpr0
522 %1:_(s32) = COPY $vgpr1
523 %2:_(s1) = G_ICMP intpred(ne), %0, %1
524 %3:_(s1), %4:_(s64) = G_INTRINSIC_W_SIDE_EFFECTS intrinsic(@llvm.amdgcn.if), %2
525 %5:_(s1) = G_CONSTANT i1 true
526 %6:_(s1) = G_XOR %3, %5
537 name: brcond_si_if_br_negated
539 ; WAVE64-LABEL: name: brcond_si_if_br_negated
541 ; WAVE64-NEXT: successors: %bb.1(0x80000000)
542 ; WAVE64-NEXT: liveins: $vgpr0, $vgpr1
543 ; WAVE64-NEXT: {{ $}}
544 ; WAVE64-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
545 ; WAVE64-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
546 ; WAVE64-NEXT: [[ICMP:%[0-9]+]]:sreg_64_xexec(s1) = G_ICMP intpred(ne), [[COPY]](s32), [[COPY1]]
547 ; WAVE64-NEXT: [[SI_IF:%[0-9]+]]:sreg_64_xexec(s64) = SI_IF [[ICMP]](s1), %bb.2, implicit-def $exec, implicit-def $scc, implicit $exec
548 ; WAVE64-NEXT: G_BR %bb.3
549 ; WAVE64-NEXT: {{ $}}
551 ; WAVE64-NEXT: successors: %bb.2(0x80000000)
552 ; WAVE64-NEXT: {{ $}}
553 ; WAVE64-NEXT: S_NOP 0
554 ; WAVE64-NEXT: {{ $}}
556 ; WAVE64-NEXT: successors: %bb.3(0x80000000)
557 ; WAVE64-NEXT: {{ $}}
558 ; WAVE64-NEXT: S_NOP 1
559 ; WAVE64-NEXT: {{ $}}
561 ; WAVE64-NEXT: S_NOP 2
562 ; WAVE32-LABEL: name: brcond_si_if_br_negated
564 ; WAVE32-NEXT: successors: %bb.1(0x80000000)
565 ; WAVE32-NEXT: liveins: $vgpr0, $vgpr1
566 ; WAVE32-NEXT: {{ $}}
567 ; WAVE32-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
568 ; WAVE32-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
569 ; WAVE32-NEXT: [[ICMP:%[0-9]+]]:sreg_32_xm0_xexec(s1) = G_ICMP intpred(ne), [[COPY]](s32), [[COPY1]]
570 ; WAVE32-NEXT: [[SI_IF:%[0-9]+]]:sreg_32_xm0_xexec(s64) = SI_IF [[ICMP]](s1), %bb.2, implicit-def $exec, implicit-def $scc, implicit $exec
571 ; WAVE32-NEXT: G_BR %bb.3
572 ; WAVE32-NEXT: {{ $}}
574 ; WAVE32-NEXT: successors: %bb.2(0x80000000)
575 ; WAVE32-NEXT: {{ $}}
576 ; WAVE32-NEXT: S_NOP 0
577 ; WAVE32-NEXT: {{ $}}
579 ; WAVE32-NEXT: successors: %bb.3(0x80000000)
580 ; WAVE32-NEXT: {{ $}}
581 ; WAVE32-NEXT: S_NOP 1
582 ; WAVE32-NEXT: {{ $}}
584 ; WAVE32-NEXT: S_NOP 2
587 liveins: $vgpr0, $vgpr1
588 %0:_(s32) = COPY $vgpr0
589 %1:_(s32) = COPY $vgpr1
590 %2:_(s1) = G_ICMP intpred(ne), %0, %1
591 %3:_(s1), %4:_(s64) = G_INTRINSIC_W_SIDE_EFFECTS intrinsic(@llvm.amdgcn.if), %2
592 %5:_(s1) = G_CONSTANT i1 true
593 %6:_(s1) = G_XOR %3, %5
608 name: brcond_si_loop_brcond_negated
609 tracksRegLiveness: true
611 ; WAVE64-LABEL: name: brcond_si_loop_brcond_negated
613 ; WAVE64-NEXT: successors: %bb.1(0x80000000)
614 ; WAVE64-NEXT: liveins: $vgpr0, $vgpr1, $sgpr0_sgpr1
615 ; WAVE64-NEXT: {{ $}}
616 ; WAVE64-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
617 ; WAVE64-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
618 ; WAVE64-NEXT: [[COPY2:%[0-9]+]]:sreg_64_xexec(s64) = COPY $sgpr0_sgpr1
619 ; WAVE64-NEXT: {{ $}}
621 ; WAVE64-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
622 ; WAVE64-NEXT: {{ $}}
623 ; WAVE64-NEXT: S_NOP 0
624 ; WAVE64-NEXT: SI_LOOP [[COPY2]](s64), %bb.1, implicit-def $exec, implicit-def $scc, implicit $exec
625 ; WAVE64-NEXT: G_BR %bb.2
626 ; WAVE64-NEXT: {{ $}}
628 ; WAVE64-NEXT: S_NOP 0
629 ; WAVE32-LABEL: name: brcond_si_loop_brcond_negated
631 ; WAVE32-NEXT: successors: %bb.1(0x80000000)
632 ; WAVE32-NEXT: liveins: $vgpr0, $vgpr1, $sgpr0_sgpr1
633 ; WAVE32-NEXT: {{ $}}
634 ; WAVE32-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
635 ; WAVE32-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
636 ; WAVE32-NEXT: [[COPY2:%[0-9]+]]:sreg_32_xm0_xexec(s64) = COPY $sgpr0_sgpr1
637 ; WAVE32-NEXT: {{ $}}
639 ; WAVE32-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
640 ; WAVE32-NEXT: {{ $}}
641 ; WAVE32-NEXT: S_NOP 0
642 ; WAVE32-NEXT: SI_LOOP [[COPY2]](s64), %bb.1, implicit-def $exec, implicit-def $scc, implicit $exec
643 ; WAVE32-NEXT: G_BR %bb.2
644 ; WAVE32-NEXT: {{ $}}
646 ; WAVE32-NEXT: S_NOP 0
648 liveins: $vgpr0, $vgpr1, $sgpr0_sgpr1
649 %0:_(s32) = COPY $vgpr0
650 %1:_(s32) = COPY $vgpr1
651 %2:_(s64) = COPY $sgpr0_sgpr1
654 successors: %bb.1, %bb.2
656 %3:_(s1) = G_INTRINSIC_W_SIDE_EFFECTS intrinsic(@llvm.amdgcn.loop), %2
657 %4:_(s1) = G_CONSTANT i1 true
658 %5:_(s1) = G_XOR %3, %4
666 name: brcond_si_loop_brcond_br_negated
667 tracksRegLiveness: true
669 ; WAVE64-LABEL: name: brcond_si_loop_brcond_br_negated
671 ; WAVE64-NEXT: successors: %bb.1(0x80000000)
672 ; WAVE64-NEXT: liveins: $vgpr0, $vgpr1, $sgpr0_sgpr1
673 ; WAVE64-NEXT: {{ $}}
674 ; WAVE64-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
675 ; WAVE64-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
676 ; WAVE64-NEXT: [[COPY2:%[0-9]+]]:sreg_64_xexec(s64) = COPY $sgpr0_sgpr1
677 ; WAVE64-NEXT: {{ $}}
679 ; WAVE64-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
680 ; WAVE64-NEXT: {{ $}}
681 ; WAVE64-NEXT: S_NOP 0
682 ; WAVE64-NEXT: SI_LOOP [[COPY2]](s64), %bb.2, implicit-def $exec, implicit-def $scc, implicit $exec
683 ; WAVE64-NEXT: G_BR %bb.1
684 ; WAVE64-NEXT: {{ $}}
686 ; WAVE64-NEXT: S_NOP 0
687 ; WAVE32-LABEL: name: brcond_si_loop_brcond_br_negated
689 ; WAVE32-NEXT: successors: %bb.1(0x80000000)
690 ; WAVE32-NEXT: liveins: $vgpr0, $vgpr1, $sgpr0_sgpr1
691 ; WAVE32-NEXT: {{ $}}
692 ; WAVE32-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
693 ; WAVE32-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
694 ; WAVE32-NEXT: [[COPY2:%[0-9]+]]:sreg_32_xm0_xexec(s64) = COPY $sgpr0_sgpr1
695 ; WAVE32-NEXT: {{ $}}
697 ; WAVE32-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
698 ; WAVE32-NEXT: {{ $}}
699 ; WAVE32-NEXT: S_NOP 0
700 ; WAVE32-NEXT: SI_LOOP [[COPY2]](s64), %bb.2, implicit-def $exec, implicit-def $scc, implicit $exec
701 ; WAVE32-NEXT: G_BR %bb.1
702 ; WAVE32-NEXT: {{ $}}
704 ; WAVE32-NEXT: S_NOP 0
706 liveins: $vgpr0, $vgpr1, $sgpr0_sgpr1
707 %0:_(s32) = COPY $vgpr0
708 %1:_(s32) = COPY $vgpr1
709 %2:_(s64) = COPY $sgpr0_sgpr1
712 successors: %bb.1, %bb.2
714 %3:_(s1) = G_INTRINSIC_W_SIDE_EFFECTS intrinsic(@llvm.amdgcn.loop), %2
715 %4:_(s1) = G_CONSTANT i1 true
716 %5:_(s1) = G_XOR %3, %4