1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple aarch64-unknown-unknown -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s
4 # Verify that we can fold shifts into G_ICMP variants.
6 # Because these are selected as a SUBS, we can fold a shift into the addressing
7 # mode in the same way.
9 # We should not have shifts in any of the compares below. These should be
10 # folded into the SUBSWrs instruction.
17 tracksRegLiveness: true
22 ; CHECK-LABEL: name: eq_shl
23 ; CHECK: liveins: $w0, $w1
24 ; CHECK: %copy0:gpr32 = COPY $w0
25 ; CHECK: %copy1:gpr32 = COPY $w1
26 ; CHECK: [[SUBSWrs:%[0-9]+]]:gpr32 = SUBSWrs %copy1, %copy0, 3, implicit-def $nzcv
27 ; CHECK: %cmp:gpr32 = CSINCWr $wzr, $wzr, 1, implicit $nzcv
28 ; CHECK: $w0 = COPY %cmp
29 ; CHECK: RET_ReallyLR implicit $w0
30 %copy0:gpr(s32) = COPY $w0
31 %copy1:gpr(s32) = COPY $w1
32 %three:gpr(s32) = G_CONSTANT i32 3
33 %shift:gpr(s32) = G_SHL %copy0, %three(s32)
34 %cmp:gpr(s32) = G_ICMP intpred(eq), %copy1(s32), %shift
36 RET_ReallyLR implicit $w0
43 tracksRegLiveness: true
48 ; CHECK-LABEL: name: eq_ashr
49 ; CHECK: liveins: $w0, $w1
50 ; CHECK: %copy0:gpr32 = COPY $w0
51 ; CHECK: %copy1:gpr32 = COPY $w1
52 ; CHECK: [[SUBSWrs:%[0-9]+]]:gpr32 = SUBSWrs %copy1, %copy0, 131, implicit-def $nzcv
53 ; CHECK: %cmp:gpr32 = CSINCWr $wzr, $wzr, 1, implicit $nzcv
54 ; CHECK: $w0 = COPY %cmp
55 ; CHECK: RET_ReallyLR implicit $w0
56 %copy0:gpr(s32) = COPY $w0
57 %copy1:gpr(s32) = COPY $w1
58 %three:gpr(s32) = G_CONSTANT i32 3
59 %shift:gpr(s32) = G_ASHR %copy0, %three(s32)
60 %cmp:gpr(s32) = G_ICMP intpred(eq), %copy1(s32), %shift
62 RET_ReallyLR implicit $w0
69 tracksRegLiveness: true
74 ; CHECK-LABEL: name: eq_lshr
75 ; CHECK: liveins: $w0, $w1
76 ; CHECK: %copy0:gpr32 = COPY $w0
77 ; CHECK: %copy1:gpr32 = COPY $w1
78 ; CHECK: [[SUBSWrs:%[0-9]+]]:gpr32 = SUBSWrs %copy1, %copy0, 67, implicit-def $nzcv
79 ; CHECK: %cmp:gpr32 = CSINCWr $wzr, $wzr, 1, implicit $nzcv
80 ; CHECK: $w0 = COPY %cmp
81 ; CHECK: RET_ReallyLR implicit $w0
82 %copy0:gpr(s32) = COPY $w0
83 %copy1:gpr(s32) = COPY $w1
84 %three:gpr(s32) = G_CONSTANT i32 3
85 %shift:gpr(s32) = G_LSHR %copy0, %three(s32)
86 %cmp:gpr(s32) = G_ICMP intpred(eq), %copy1(s32), %shift
88 RET_ReallyLR implicit $w0
95 tracksRegLiveness: true
100 ; CHECK-LABEL: name: ne_shl
101 ; CHECK: liveins: $w0, $w1
102 ; CHECK: %copy0:gpr32 = COPY $w0
103 ; CHECK: %copy1:gpr32 = COPY $w1
104 ; CHECK: [[SUBSWrs:%[0-9]+]]:gpr32 = SUBSWrs %copy1, %copy0, 3, implicit-def $nzcv
105 ; CHECK: %cmp:gpr32 = CSINCWr $wzr, $wzr, 0, implicit $nzcv
106 ; CHECK: $w0 = COPY %cmp
107 ; CHECK: RET_ReallyLR implicit $w0
108 %copy0:gpr(s32) = COPY $w0
109 %copy1:gpr(s32) = COPY $w1
110 %three:gpr(s32) = G_CONSTANT i32 3
111 %shift:gpr(s32) = G_SHL %copy0, %three(s32)
112 %cmp:gpr(s32) = G_ICMP intpred(ne), %copy1(s32), %shift
114 RET_ReallyLR implicit $w0
120 regBankSelected: true
121 tracksRegLiveness: true
126 ; CHECK-LABEL: name: ne_ashr
127 ; CHECK: liveins: $w0, $w1
128 ; CHECK: %copy0:gpr32 = COPY $w0
129 ; CHECK: %copy1:gpr32 = COPY $w1
130 ; CHECK: [[SUBSWrs:%[0-9]+]]:gpr32 = SUBSWrs %copy1, %copy0, 131, implicit-def $nzcv
131 ; CHECK: %cmp:gpr32 = CSINCWr $wzr, $wzr, 0, implicit $nzcv
132 ; CHECK: $w0 = COPY %cmp
133 ; CHECK: RET_ReallyLR implicit $w0
134 %copy0:gpr(s32) = COPY $w0
135 %copy1:gpr(s32) = COPY $w1
136 %three:gpr(s32) = G_CONSTANT i32 3
137 %shift:gpr(s32) = G_ASHR %copy0, %three(s32)
138 %cmp:gpr(s32) = G_ICMP intpred(ne), %copy1(s32), %shift
140 RET_ReallyLR implicit $w0
146 regBankSelected: true
147 tracksRegLiveness: true
152 ; CHECK-LABEL: name: ne_lshr
153 ; CHECK: liveins: $w0, $w1
154 ; CHECK: %copy0:gpr32 = COPY $w0
155 ; CHECK: %copy1:gpr32 = COPY $w1
156 ; CHECK: [[SUBSWrs:%[0-9]+]]:gpr32 = SUBSWrs %copy1, %copy0, 67, implicit-def $nzcv
157 ; CHECK: %cmp:gpr32 = CSINCWr $wzr, $wzr, 0, implicit $nzcv
158 ; CHECK: $w0 = COPY %cmp
159 ; CHECK: RET_ReallyLR implicit $w0
160 %copy0:gpr(s32) = COPY $w0
161 %copy1:gpr(s32) = COPY $w1
162 %three:gpr(s32) = G_CONSTANT i32 3
163 %shift:gpr(s32) = G_LSHR %copy0, %three(s32)
164 %cmp:gpr(s32) = G_ICMP intpred(ne), %copy1(s32), %shift
166 RET_ReallyLR implicit $w0
172 regBankSelected: true
173 tracksRegLiveness: true
178 ; CHECK-LABEL: name: ult_shl
179 ; CHECK: liveins: $w0, $w1
180 ; CHECK: %copy0:gpr32 = COPY $w0
181 ; CHECK: %copy1:gpr32 = COPY $w1
182 ; CHECK: [[SUBSWrs:%[0-9]+]]:gpr32 = SUBSWrs %copy1, %copy0, 3, implicit-def $nzcv
183 ; CHECK: %cmp:gpr32 = CSINCWr $wzr, $wzr, 2, implicit $nzcv
184 ; CHECK: $w0 = COPY %cmp
185 ; CHECK: RET_ReallyLR implicit $w0
186 %copy0:gpr(s32) = COPY $w0
187 %copy1:gpr(s32) = COPY $w1
188 %three:gpr(s32) = G_CONSTANT i32 3
189 %shift:gpr(s32) = G_SHL %copy0, %three(s32)
190 %cmp:gpr(s32) = G_ICMP intpred(ult), %copy1(s32), %shift
192 RET_ReallyLR implicit $w0
197 regBankSelected: true
198 tracksRegLiveness: true
203 ; CHECK-LABEL: name: ult_ashr
204 ; CHECK: liveins: $w0, $w1
205 ; CHECK: %copy0:gpr32 = COPY $w0
206 ; CHECK: %copy1:gpr32 = COPY $w1
207 ; CHECK: [[SUBSWrs:%[0-9]+]]:gpr32 = SUBSWrs %copy1, %copy0, 131, implicit-def $nzcv
208 ; CHECK: %cmp:gpr32 = CSINCWr $wzr, $wzr, 2, implicit $nzcv
209 ; CHECK: $w0 = COPY %cmp
210 ; CHECK: RET_ReallyLR implicit $w0
211 %copy0:gpr(s32) = COPY $w0
212 %copy1:gpr(s32) = COPY $w1
213 %three:gpr(s32) = G_CONSTANT i32 3
214 %shift:gpr(s32) = G_ASHR %copy0, %three(s32)
215 %cmp:gpr(s32) = G_ICMP intpred(ult), %copy1(s32), %shift
217 RET_ReallyLR implicit $w0
222 regBankSelected: true
223 tracksRegLiveness: true
228 ; CHECK-LABEL: name: ult_lshr
229 ; CHECK: liveins: $w0, $w1
230 ; CHECK: %copy0:gpr32 = COPY $w0
231 ; CHECK: %copy1:gpr32 = COPY $w1
232 ; CHECK: [[SUBSWrs:%[0-9]+]]:gpr32 = SUBSWrs %copy1, %copy0, 67, implicit-def $nzcv
233 ; CHECK: %cmp:gpr32 = CSINCWr $wzr, $wzr, 2, implicit $nzcv
234 ; CHECK: $w0 = COPY %cmp
235 ; CHECK: RET_ReallyLR implicit $w0
236 %copy0:gpr(s32) = COPY $w0
237 %copy1:gpr(s32) = COPY $w1
238 %three:gpr(s32) = G_CONSTANT i32 3
239 %shift:gpr(s32) = G_LSHR %copy0, %three(s32)
240 %cmp:gpr(s32) = G_ICMP intpred(ult), %copy1(s32), %shift
242 RET_ReallyLR implicit $w0
247 regBankSelected: true
248 tracksRegLiveness: true
253 ; CHECK-LABEL: name: ugt_shl
254 ; CHECK: liveins: $w0, $w1
255 ; CHECK: %copy0:gpr32 = COPY $w0
256 ; CHECK: %copy1:gpr32 = COPY $w1
257 ; CHECK: [[SUBSWrs:%[0-9]+]]:gpr32 = SUBSWrs %copy1, %copy0, 3, implicit-def $nzcv
258 ; CHECK: %cmp:gpr32 = CSINCWr $wzr, $wzr, 9, implicit $nzcv
259 ; CHECK: $w0 = COPY %cmp
260 ; CHECK: RET_ReallyLR implicit $w0
261 %copy0:gpr(s32) = COPY $w0
262 %copy1:gpr(s32) = COPY $w1
263 %three:gpr(s32) = G_CONSTANT i32 3
264 %shift:gpr(s32) = G_SHL %copy0, %three(s32)
265 %cmp:gpr(s32) = G_ICMP intpred(ugt), %copy1(s32), %shift
267 RET_ReallyLR implicit $w0
272 regBankSelected: true
273 tracksRegLiveness: true
278 ; CHECK-LABEL: name: ugt_ashr
279 ; CHECK: liveins: $w0, $w1
280 ; CHECK: %copy0:gpr32 = COPY $w0
281 ; CHECK: %copy1:gpr32 = COPY $w1
282 ; CHECK: [[SUBSWrs:%[0-9]+]]:gpr32 = SUBSWrs %copy1, %copy0, 131, implicit-def $nzcv
283 ; CHECK: %cmp:gpr32 = CSINCWr $wzr, $wzr, 9, implicit $nzcv
284 ; CHECK: $w0 = COPY %cmp
285 ; CHECK: RET_ReallyLR implicit $w0
286 %copy0:gpr(s32) = COPY $w0
287 %copy1:gpr(s32) = COPY $w1
288 %three:gpr(s32) = G_CONSTANT i32 3
289 %shift:gpr(s32) = G_ASHR %copy0, %three(s32)
290 %cmp:gpr(s32) = G_ICMP intpred(ugt), %copy1(s32), %shift
292 RET_ReallyLR implicit $w0
297 regBankSelected: true
298 tracksRegLiveness: true
303 ; CHECK-LABEL: name: ugt_lshr
304 ; CHECK: liveins: $w0, $w1
305 ; CHECK: %copy0:gpr32 = COPY $w0
306 ; CHECK: %copy1:gpr32 = COPY $w1
307 ; CHECK: [[SUBSWrs:%[0-9]+]]:gpr32 = SUBSWrs %copy1, %copy0, 67, implicit-def $nzcv
308 ; CHECK: %cmp:gpr32 = CSINCWr $wzr, $wzr, 9, implicit $nzcv
309 ; CHECK: $w0 = COPY %cmp
310 ; CHECK: RET_ReallyLR implicit $w0
311 %copy0:gpr(s32) = COPY $w0
312 %copy1:gpr(s32) = COPY $w1
313 %three:gpr(s32) = G_CONSTANT i32 3
314 %shift:gpr(s32) = G_LSHR %copy0, %three(s32)
315 %cmp:gpr(s32) = G_ICMP intpred(ugt), %copy1(s32), %shift
317 RET_ReallyLR implicit $w0
324 regBankSelected: true
325 tracksRegLiveness: true
330 ; CHECK-LABEL: name: uge_shl
331 ; CHECK: liveins: $w0, $w1
332 ; CHECK: %copy0:gpr32 = COPY $w0
333 ; CHECK: %copy1:gpr32 = COPY $w1
334 ; CHECK: [[SUBSWrs:%[0-9]+]]:gpr32 = SUBSWrs %copy1, %copy0, 3, implicit-def $nzcv
335 ; CHECK: %cmp:gpr32 = CSINCWr $wzr, $wzr, 3, implicit $nzcv
336 ; CHECK: $w0 = COPY %cmp
337 ; CHECK: RET_ReallyLR implicit $w0
338 %copy0:gpr(s32) = COPY $w0
339 %copy1:gpr(s32) = COPY $w1
340 %three:gpr(s32) = G_CONSTANT i32 3
341 %shift:gpr(s32) = G_SHL %copy0, %three(s32)
342 %cmp:gpr(s32) = G_ICMP intpred(uge), %copy1(s32), %shift
344 RET_ReallyLR implicit $w0
349 regBankSelected: true
350 tracksRegLiveness: true
355 ; CHECK-LABEL: name: uge_ashr
356 ; CHECK: liveins: $w0, $w1
357 ; CHECK: %copy0:gpr32 = COPY $w0
358 ; CHECK: %copy1:gpr32 = COPY $w1
359 ; CHECK: [[SUBSWrs:%[0-9]+]]:gpr32 = SUBSWrs %copy1, %copy0, 131, implicit-def $nzcv
360 ; CHECK: %cmp:gpr32 = CSINCWr $wzr, $wzr, 3, implicit $nzcv
361 ; CHECK: $w0 = COPY %cmp
362 ; CHECK: RET_ReallyLR implicit $w0
363 %copy0:gpr(s32) = COPY $w0
364 %copy1:gpr(s32) = COPY $w1
365 %three:gpr(s32) = G_CONSTANT i32 3
366 %shift:gpr(s32) = G_ASHR %copy0, %three(s32)
367 %cmp:gpr(s32) = G_ICMP intpred(uge), %copy1(s32), %shift
369 RET_ReallyLR implicit $w0
374 regBankSelected: true
375 tracksRegLiveness: true
380 ; CHECK-LABEL: name: uge_lshr
381 ; CHECK: liveins: $w0, $w1
382 ; CHECK: %copy0:gpr32 = COPY $w0
383 ; CHECK: %copy1:gpr32 = COPY $w1
384 ; CHECK: [[SUBSWrs:%[0-9]+]]:gpr32 = SUBSWrs %copy1, %copy0, 67, implicit-def $nzcv
385 ; CHECK: %cmp:gpr32 = CSINCWr $wzr, $wzr, 3, implicit $nzcv
386 ; CHECK: $w0 = COPY %cmp
387 ; CHECK: RET_ReallyLR implicit $w0
388 %copy0:gpr(s32) = COPY $w0
389 %copy1:gpr(s32) = COPY $w1
390 %three:gpr(s32) = G_CONSTANT i32 3
391 %shift:gpr(s32) = G_LSHR %copy0, %three(s32)
392 %cmp:gpr(s32) = G_ICMP intpred(uge), %copy1(s32), %shift
394 RET_ReallyLR implicit $w0
401 regBankSelected: true
402 tracksRegLiveness: true
407 ; CHECK-LABEL: name: ule_shl
408 ; CHECK: liveins: $w0, $w1
409 ; CHECK: %copy0:gpr32 = COPY $w0
410 ; CHECK: %copy1:gpr32 = COPY $w1
411 ; CHECK: [[SUBSWrs:%[0-9]+]]:gpr32 = SUBSWrs %copy1, %copy0, 3, implicit-def $nzcv
412 ; CHECK: %cmp:gpr32 = CSINCWr $wzr, $wzr, 8, implicit $nzcv
413 ; CHECK: $w0 = COPY %cmp
414 ; CHECK: RET_ReallyLR implicit $w0
415 %copy0:gpr(s32) = COPY $w0
416 %copy1:gpr(s32) = COPY $w1
417 %three:gpr(s32) = G_CONSTANT i32 3
418 %shift:gpr(s32) = G_SHL %copy0, %three(s32)
419 %cmp:gpr(s32) = G_ICMP intpred(ule), %copy1(s32), %shift
421 RET_ReallyLR implicit $w0
426 regBankSelected: true
427 tracksRegLiveness: true
432 ; CHECK-LABEL: name: ule_ashr
433 ; CHECK: liveins: $w0, $w1
434 ; CHECK: %copy0:gpr32 = COPY $w0
435 ; CHECK: %copy1:gpr32 = COPY $w1
436 ; CHECK: [[SUBSWrs:%[0-9]+]]:gpr32 = SUBSWrs %copy1, %copy0, 131, implicit-def $nzcv
437 ; CHECK: %cmp:gpr32 = CSINCWr $wzr, $wzr, 8, implicit $nzcv
438 ; CHECK: $w0 = COPY %cmp
439 ; CHECK: RET_ReallyLR implicit $w0
440 %copy0:gpr(s32) = COPY $w0
441 %copy1:gpr(s32) = COPY $w1
442 %three:gpr(s32) = G_CONSTANT i32 3
443 %shift:gpr(s32) = G_ASHR %copy0, %three(s32)
444 %cmp:gpr(s32) = G_ICMP intpred(ule), %copy1(s32), %shift
446 RET_ReallyLR implicit $w0
451 regBankSelected: true
452 tracksRegLiveness: true
457 ; CHECK-LABEL: name: ule_lshr
458 ; CHECK: liveins: $w0, $w1
459 ; CHECK: %copy0:gpr32 = COPY $w0
460 ; CHECK: %copy1:gpr32 = COPY $w1
461 ; CHECK: [[SUBSWrs:%[0-9]+]]:gpr32 = SUBSWrs %copy1, %copy0, 67, implicit-def $nzcv
462 ; CHECK: %cmp:gpr32 = CSINCWr $wzr, $wzr, 8, implicit $nzcv
463 ; CHECK: $w0 = COPY %cmp
464 ; CHECK: RET_ReallyLR implicit $w0
465 %copy0:gpr(s32) = COPY $w0
466 %copy1:gpr(s32) = COPY $w1
467 %three:gpr(s32) = G_CONSTANT i32 3
468 %shift:gpr(s32) = G_LSHR %copy0, %three(s32)
469 %cmp:gpr(s32) = G_ICMP intpred(ule), %copy1(s32), %shift
471 RET_ReallyLR implicit $w0
477 regBankSelected: true
478 tracksRegLiveness: true
483 ; CHECK-LABEL: name: slt_shl
484 ; CHECK: liveins: $w0, $w1
485 ; CHECK: %copy0:gpr32 = COPY $w0
486 ; CHECK: %copy1:gpr32 = COPY $w1
487 ; CHECK: [[SUBSWrs:%[0-9]+]]:gpr32 = SUBSWrs %copy1, %copy0, 3, implicit-def $nzcv
488 ; CHECK: %cmp:gpr32 = CSINCWr $wzr, $wzr, 10, implicit $nzcv
489 ; CHECK: $w0 = COPY %cmp
490 ; CHECK: RET_ReallyLR implicit $w0
491 %copy0:gpr(s32) = COPY $w0
492 %copy1:gpr(s32) = COPY $w1
493 %three:gpr(s32) = G_CONSTANT i32 3
494 %shift:gpr(s32) = G_SHL %copy0, %three(s32)
495 %cmp:gpr(s32) = G_ICMP intpred(slt), %copy1(s32), %shift
497 RET_ReallyLR implicit $w0
502 regBankSelected: true
503 tracksRegLiveness: true
508 ; CHECK-LABEL: name: slt_ashr
509 ; CHECK: liveins: $w0, $w1
510 ; CHECK: %copy0:gpr32 = COPY $w0
511 ; CHECK: %copy1:gpr32 = COPY $w1
512 ; CHECK: [[SUBSWrs:%[0-9]+]]:gpr32 = SUBSWrs %copy1, %copy0, 131, implicit-def $nzcv
513 ; CHECK: %cmp:gpr32 = CSINCWr $wzr, $wzr, 10, implicit $nzcv
514 ; CHECK: $w0 = COPY %cmp
515 ; CHECK: RET_ReallyLR implicit $w0
516 %copy0:gpr(s32) = COPY $w0
517 %copy1:gpr(s32) = COPY $w1
518 %three:gpr(s32) = G_CONSTANT i32 3
519 %shift:gpr(s32) = G_ASHR %copy0, %three(s32)
520 %cmp:gpr(s32) = G_ICMP intpred(slt), %copy1(s32), %shift
522 RET_ReallyLR implicit $w0
527 regBankSelected: true
528 tracksRegLiveness: true
533 ; CHECK-LABEL: name: slt_lshr
534 ; CHECK: liveins: $w0, $w1
535 ; CHECK: %copy0:gpr32 = COPY $w0
536 ; CHECK: %copy1:gpr32 = COPY $w1
537 ; CHECK: [[SUBSWrs:%[0-9]+]]:gpr32 = SUBSWrs %copy1, %copy0, 67, implicit-def $nzcv
538 ; CHECK: %cmp:gpr32 = CSINCWr $wzr, $wzr, 10, implicit $nzcv
539 ; CHECK: $w0 = COPY %cmp
540 ; CHECK: RET_ReallyLR implicit $w0
541 %copy0:gpr(s32) = COPY $w0
542 %copy1:gpr(s32) = COPY $w1
543 %three:gpr(s32) = G_CONSTANT i32 3
544 %shift:gpr(s32) = G_LSHR %copy0, %three(s32)
545 %cmp:gpr(s32) = G_ICMP intpred(slt), %copy1(s32), %shift
547 RET_ReallyLR implicit $w0
552 regBankSelected: true
553 tracksRegLiveness: true
558 ; CHECK-LABEL: name: sgt_shl
559 ; CHECK: liveins: $w0, $w1
560 ; CHECK: %copy0:gpr32 = COPY $w0
561 ; CHECK: %copy1:gpr32 = COPY $w1
562 ; CHECK: [[SUBSWrs:%[0-9]+]]:gpr32 = SUBSWrs %copy1, %copy0, 3, implicit-def $nzcv
563 ; CHECK: %cmp:gpr32 = CSINCWr $wzr, $wzr, 13, implicit $nzcv
564 ; CHECK: $w0 = COPY %cmp
565 ; CHECK: RET_ReallyLR implicit $w0
566 %copy0:gpr(s32) = COPY $w0
567 %copy1:gpr(s32) = COPY $w1
568 %three:gpr(s32) = G_CONSTANT i32 3
569 %shift:gpr(s32) = G_SHL %copy0, %three(s32)
570 %cmp:gpr(s32) = G_ICMP intpred(sgt), %copy1(s32), %shift
572 RET_ReallyLR implicit $w0
577 regBankSelected: true
578 tracksRegLiveness: true
583 ; CHECK-LABEL: name: sgt_ashr
584 ; CHECK: liveins: $w0, $w1
585 ; CHECK: %copy0:gpr32 = COPY $w0
586 ; CHECK: %copy1:gpr32 = COPY $w1
587 ; CHECK: [[SUBSWrs:%[0-9]+]]:gpr32 = SUBSWrs %copy1, %copy0, 131, implicit-def $nzcv
588 ; CHECK: %cmp:gpr32 = CSINCWr $wzr, $wzr, 13, implicit $nzcv
589 ; CHECK: $w0 = COPY %cmp
590 ; CHECK: RET_ReallyLR implicit $w0
591 %copy0:gpr(s32) = COPY $w0
592 %copy1:gpr(s32) = COPY $w1
593 %three:gpr(s32) = G_CONSTANT i32 3
594 %shift:gpr(s32) = G_ASHR %copy0, %three(s32)
595 %cmp:gpr(s32) = G_ICMP intpred(sgt), %copy1(s32), %shift
597 RET_ReallyLR implicit $w0
602 regBankSelected: true
603 tracksRegLiveness: true
608 ; CHECK-LABEL: name: sgt_lshr
609 ; CHECK: liveins: $w0, $w1
610 ; CHECK: %copy0:gpr32 = COPY $w0
611 ; CHECK: %copy1:gpr32 = COPY $w1
612 ; CHECK: [[SUBSWrs:%[0-9]+]]:gpr32 = SUBSWrs %copy1, %copy0, 67, implicit-def $nzcv
613 ; CHECK: %cmp:gpr32 = CSINCWr $wzr, $wzr, 13, implicit $nzcv
614 ; CHECK: $w0 = COPY %cmp
615 ; CHECK: RET_ReallyLR implicit $w0
616 %copy0:gpr(s32) = COPY $w0
617 %copy1:gpr(s32) = COPY $w1
618 %three:gpr(s32) = G_CONSTANT i32 3
619 %shift:gpr(s32) = G_LSHR %copy0, %three(s32)
620 %cmp:gpr(s32) = G_ICMP intpred(sgt), %copy1(s32), %shift
622 RET_ReallyLR implicit $w0
627 regBankSelected: true
628 tracksRegLiveness: true
633 ; CHECK-LABEL: name: sge_shl
634 ; CHECK: liveins: $w0, $w1
635 ; CHECK: %copy0:gpr32 = COPY $w0
636 ; CHECK: %copy1:gpr32 = COPY $w1
637 ; CHECK: [[SUBSWrs:%[0-9]+]]:gpr32 = SUBSWrs %copy1, %copy0, 3, implicit-def $nzcv
638 ; CHECK: %cmp:gpr32 = CSINCWr $wzr, $wzr, 11, implicit $nzcv
639 ; CHECK: $w0 = COPY %cmp
640 ; CHECK: RET_ReallyLR implicit $w0
641 %copy0:gpr(s32) = COPY $w0
642 %copy1:gpr(s32) = COPY $w1
643 %three:gpr(s32) = G_CONSTANT i32 3
644 %shift:gpr(s32) = G_SHL %copy0, %three(s32)
645 %cmp:gpr(s32) = G_ICMP intpred(sge), %copy1(s32), %shift
647 RET_ReallyLR implicit $w0
652 regBankSelected: true
653 tracksRegLiveness: true
658 ; CHECK-LABEL: name: sge_ashr
659 ; CHECK: liveins: $w0, $w1
660 ; CHECK: %copy0:gpr32 = COPY $w0
661 ; CHECK: %copy1:gpr32 = COPY $w1
662 ; CHECK: [[SUBSWrs:%[0-9]+]]:gpr32 = SUBSWrs %copy1, %copy0, 131, implicit-def $nzcv
663 ; CHECK: %cmp:gpr32 = CSINCWr $wzr, $wzr, 11, implicit $nzcv
664 ; CHECK: $w0 = COPY %cmp
665 ; CHECK: RET_ReallyLR implicit $w0
666 %copy0:gpr(s32) = COPY $w0
667 %copy1:gpr(s32) = COPY $w1
668 %three:gpr(s32) = G_CONSTANT i32 3
669 %shift:gpr(s32) = G_ASHR %copy0, %three(s32)
670 %cmp:gpr(s32) = G_ICMP intpred(sge), %copy1(s32), %shift
672 RET_ReallyLR implicit $w0
677 regBankSelected: true
678 tracksRegLiveness: true
683 ; CHECK-LABEL: name: sge_lshr
684 ; CHECK: liveins: $w0, $w1
685 ; CHECK: %copy0:gpr32 = COPY $w0
686 ; CHECK: %copy1:gpr32 = COPY $w1
687 ; CHECK: [[SUBSWrs:%[0-9]+]]:gpr32 = SUBSWrs %copy1, %copy0, 67, implicit-def $nzcv
688 ; CHECK: %cmp:gpr32 = CSINCWr $wzr, $wzr, 11, implicit $nzcv
689 ; CHECK: $w0 = COPY %cmp
690 ; CHECK: RET_ReallyLR implicit $w0
691 %copy0:gpr(s32) = COPY $w0
692 %copy1:gpr(s32) = COPY $w1
693 %three:gpr(s32) = G_CONSTANT i32 3
694 %shift:gpr(s32) = G_LSHR %copy0, %three(s32)
695 %cmp:gpr(s32) = G_ICMP intpred(sge), %copy1(s32), %shift
697 RET_ReallyLR implicit $w0
704 regBankSelected: true
705 tracksRegLiveness: true
710 ; CHECK-LABEL: name: sle_shl
711 ; CHECK: liveins: $w0, $w1
712 ; CHECK: %copy0:gpr32 = COPY $w0
713 ; CHECK: %copy1:gpr32 = COPY $w1
714 ; CHECK: [[SUBSWrs:%[0-9]+]]:gpr32 = SUBSWrs %copy1, %copy0, 3, implicit-def $nzcv
715 ; CHECK: %cmp:gpr32 = CSINCWr $wzr, $wzr, 12, implicit $nzcv
716 ; CHECK: $w0 = COPY %cmp
717 ; CHECK: RET_ReallyLR implicit $w0
718 %copy0:gpr(s32) = COPY $w0
719 %copy1:gpr(s32) = COPY $w1
720 %three:gpr(s32) = G_CONSTANT i32 3
721 %shift:gpr(s32) = G_SHL %copy0, %three(s32)
722 %cmp:gpr(s32) = G_ICMP intpred(sle), %copy1(s32), %shift
724 RET_ReallyLR implicit $w0
729 regBankSelected: true
730 tracksRegLiveness: true
735 ; CHECK-LABEL: name: sle_ashr
736 ; CHECK: liveins: $w0, $w1
737 ; CHECK: %copy0:gpr32 = COPY $w0
738 ; CHECK: %copy1:gpr32 = COPY $w1
739 ; CHECK: [[SUBSWrs:%[0-9]+]]:gpr32 = SUBSWrs %copy1, %copy0, 131, implicit-def $nzcv
740 ; CHECK: %cmp:gpr32 = CSINCWr $wzr, $wzr, 12, implicit $nzcv
741 ; CHECK: $w0 = COPY %cmp
742 ; CHECK: RET_ReallyLR implicit $w0
743 %copy0:gpr(s32) = COPY $w0
744 %copy1:gpr(s32) = COPY $w1
745 %three:gpr(s32) = G_CONSTANT i32 3
746 %shift:gpr(s32) = G_ASHR %copy0, %three(s32)
747 %cmp:gpr(s32) = G_ICMP intpred(sle), %copy1(s32), %shift
749 RET_ReallyLR implicit $w0
754 regBankSelected: true
755 tracksRegLiveness: true
760 ; CHECK-LABEL: name: sle_lshr
761 ; CHECK: liveins: $w0, $w1
762 ; CHECK: %copy0:gpr32 = COPY $w0
763 ; CHECK: %copy1:gpr32 = COPY $w1
764 ; CHECK: [[SUBSWrs:%[0-9]+]]:gpr32 = SUBSWrs %copy1, %copy0, 67, implicit-def $nzcv
765 ; CHECK: %cmp:gpr32 = CSINCWr $wzr, $wzr, 12, implicit $nzcv
766 ; CHECK: $w0 = COPY %cmp
767 ; CHECK: RET_ReallyLR implicit $w0
768 %copy0:gpr(s32) = COPY $w0
769 %copy1:gpr(s32) = COPY $w1
770 %three:gpr(s32) = G_CONSTANT i32 3
771 %shift:gpr(s32) = G_LSHR %copy0, %three(s32)
772 %cmp:gpr(s32) = G_ICMP intpred(sle), %copy1(s32), %shift
774 RET_ReallyLR implicit $w0