1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -o - -mtriple=aarch64-unknown-unknown -run-pass=aarch64-prelegalizer-combiner -verify-machineinstrs %s | FileCheck %s
11 ; CHECK-LABEL: name: freeze_register
14 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
15 ; CHECK-NEXT: [[FREEZE:%[0-9]+]]:_(s64) = G_FREEZE [[COPY]]
16 ; CHECK-NEXT: $x0 = COPY [[FREEZE]](s64)
17 ; CHECK-NEXT: RET_ReallyLR implicit $x0
19 %1:_(s64) = G_FREEZE %0
21 RET_ReallyLR implicit $x0
30 ; CHECK-LABEL: name: freeze_constant
33 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 9
34 ; CHECK-NEXT: $x0 = COPY [[C]](s64)
35 ; CHECK-NEXT: RET_ReallyLR implicit $x0
36 %1:_(s64) = G_CONSTANT i64 9
37 %2:_(s64) = G_FREEZE %1
39 RET_ReallyLR implicit $x0
43 name: freeze_fconstant
48 ; CHECK-LABEL: name: freeze_fconstant
51 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_FCONSTANT double 9.000000e+00
52 ; CHECK-NEXT: $x0 = COPY [[C]](s64)
53 ; CHECK-NEXT: RET_ReallyLR implicit $x0
54 %1:_(s64) = G_FCONSTANT double 9.0
55 %2:_(s64) = G_FREEZE %1
57 RET_ReallyLR implicit $x0
65 ; CHECK-LABEL: name: freeze_undef
68 ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(s64) = G_IMPLICIT_DEF
69 ; CHECK-NEXT: [[FREEZE:%[0-9]+]]:_(s64) = G_FREEZE [[DEF]]
70 ; CHECK-NEXT: $x0 = COPY [[FREEZE]](s64)
71 ; CHECK-NEXT: RET_ReallyLR implicit $x0
72 %1:_(s64) = G_IMPLICIT_DEF
73 %2:_(s64) = G_FREEZE %1
75 RET_ReallyLR implicit $x0
83 ; CHECK-LABEL: name: freeze_freeze
86 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
87 ; CHECK-NEXT: [[FREEZE:%[0-9]+]]:_(s64) = G_FREEZE [[COPY]]
88 ; CHECK-NEXT: $x0 = COPY [[FREEZE]](s64)
89 ; CHECK-NEXT: RET_ReallyLR implicit $x0
91 %1:_(s64) = G_FREEZE %0
92 %2:_(s64) = G_FREEZE %1
94 RET_ReallyLR implicit $x0
97 name: freeze_buildvector
102 ; CHECK-LABEL: name: freeze_buildvector
103 ; CHECK: liveins: $w0
105 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
106 ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:_(<4 x s32>) = G_BUILD_VECTOR [[COPY]](s32), [[COPY]](s32), [[COPY]](s32), [[COPY]](s32)
107 ; CHECK-NEXT: [[FREEZE:%[0-9]+]]:_(<4 x s32>) = G_FREEZE [[BUILD_VECTOR]]
108 ; CHECK-NEXT: $q0 = COPY [[FREEZE]](<4 x s32>)
109 ; CHECK-NEXT: RET_ReallyLR implicit $q0
111 %1:_(<4 x s32>) = G_BUILD_VECTOR %0(s32), %0(s32), %0(s32), %0(s32)
112 %2:_(<4 x s32>) = G_FREEZE %1
113 $q0 = COPY %2(<4 x s32>)
114 RET_ReallyLR implicit $q0
117 name: freeze_buildvector_const
122 ; CHECK-LABEL: name: freeze_buildvector_const
123 ; CHECK: liveins: $w0
125 ; CHECK-NEXT: %c:_(s32) = G_CONSTANT i32 6
126 ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:_(<4 x s32>) = G_BUILD_VECTOR %c(s32), %c(s32), %c(s32), %c(s32)
127 ; CHECK-NEXT: $q0 = COPY [[BUILD_VECTOR]](<4 x s32>)
128 ; CHECK-NEXT: RET_ReallyLR implicit $q0
130 %c:_(s32) = G_CONSTANT i32 6
131 %1:_(<4 x s32>) = G_BUILD_VECTOR %c(s32), %c(s32), %c(s32), %c(s32)
132 %2:_(<4 x s32>) = G_FREEZE %1
133 $q0 = COPY %2(<4 x s32>)
134 RET_ReallyLR implicit $q0
137 name: freeze_disjoint_or_fold_barrier
142 ; CHECK-LABEL: name: freeze_disjoint_or_fold_barrier
143 ; CHECK: liveins: $w0
145 ; CHECK-NEXT: %cst:_(s64) = G_CONSTANT i64 9
146 ; CHECK-NEXT: %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
147 ; CHECK-NEXT: $x0 = COPY %c(s64)
148 ; CHECK-NEXT: RET_ReallyLR implicit $x0
150 %cst:_(s64) = G_CONSTANT i64 9
151 %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
152 %1:_(s64) = disjoint G_OR %c, %c
153 %2:_(s64) = G_FREEZE %1
155 RET_ReallyLR implicit $x0
158 name: freeze_or_fold_barrier
163 ; CHECK-LABEL: name: freeze_or_fold_barrier
164 ; CHECK: liveins: $w0
166 ; CHECK-NEXT: %cst:_(s64) = G_CONSTANT i64 9
167 ; CHECK-NEXT: %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
168 ; CHECK-NEXT: $x0 = COPY %c(s64)
169 ; CHECK-NEXT: RET_ReallyLR implicit $x0
171 %cst:_(s64) = G_CONSTANT i64 9
172 %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
173 %1:_(s64) = G_OR %c, %c
174 %2:_(s64) = G_FREEZE %1
176 RET_ReallyLR implicit $x0
179 name: freeze_nneg_zext_fold_barrier
184 ; CHECK-LABEL: name: freeze_nneg_zext_fold_barrier
185 ; CHECK: liveins: $w0
187 ; CHECK-NEXT: %cst:_(s32) = G_CONSTANT i32 9
188 ; CHECK-NEXT: %c:_(s32) = G_CONSTANT_FOLD_BARRIER %cst
189 ; CHECK-NEXT: [[ZEXT:%[0-9]+]]:_(s64) = G_ZEXT %c(s32)
190 ; CHECK-NEXT: $x0 = COPY [[ZEXT]](s64)
191 ; CHECK-NEXT: RET_ReallyLR implicit $x0
193 %cst:_(s32) = G_CONSTANT i32 9
194 %c:_(s32) = G_CONSTANT_FOLD_BARRIER %cst
195 %1:_(s64) = nneg G_ZEXT %c
196 %2:_(s64) = G_FREEZE %1
198 RET_ReallyLR implicit $x0
201 name: freeze_zext_fold_barrier
206 ; CHECK-LABEL: name: freeze_zext_fold_barrier
207 ; CHECK: liveins: $w0
209 ; CHECK-NEXT: %cst:_(s32) = G_CONSTANT i32 9
210 ; CHECK-NEXT: %c:_(s32) = G_CONSTANT_FOLD_BARRIER %cst
211 ; CHECK-NEXT: [[ZEXT:%[0-9]+]]:_(s64) = G_ZEXT %c(s32)
212 ; CHECK-NEXT: $x0 = COPY [[ZEXT]](s64)
213 ; CHECK-NEXT: RET_ReallyLR implicit $x0
215 %cst:_(s32) = G_CONSTANT i32 9
216 %c:_(s32) = G_CONSTANT_FOLD_BARRIER %cst
217 %1:_(s64) = G_ZEXT %c
218 %2:_(s64) = G_FREEZE %1
220 RET_ReallyLR implicit $x0
223 name: freeze_udiv_fold_barrier
228 ; CHECK-LABEL: name: freeze_udiv_fold_barrier
229 ; CHECK: liveins: $w0
231 ; CHECK-NEXT: %cst:_(s64) = G_CONSTANT i64 9
232 ; CHECK-NEXT: %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
233 ; CHECK-NEXT: [[UDIV:%[0-9]+]]:_(s64) = G_UDIV %c, %c
234 ; CHECK-NEXT: $x0 = COPY [[UDIV]](s64)
235 ; CHECK-NEXT: RET_ReallyLR implicit $x0
237 %cst:_(s64) = G_CONSTANT i64 9
238 %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
239 %1:_(s64) = G_UDIV %c, %c
240 %2:_(s64) = G_FREEZE %1
242 RET_ReallyLR implicit $x0
245 name: freeze_exact_udiv_fold_barrier
250 ; CHECK-LABEL: name: freeze_exact_udiv_fold_barrier
251 ; CHECK: liveins: $w0
253 ; CHECK-NEXT: %cst:_(s64) = G_CONSTANT i64 9
254 ; CHECK-NEXT: %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
255 ; CHECK-NEXT: [[UDIV:%[0-9]+]]:_(s64) = G_UDIV %c, %c
256 ; CHECK-NEXT: $x0 = COPY [[UDIV]](s64)
257 ; CHECK-NEXT: RET_ReallyLR implicit $x0
259 %cst:_(s64) = G_CONSTANT i64 9
260 %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
261 %1:_(s64) = exact G_UDIV %c, %c
262 %2:_(s64) = G_FREEZE %1
264 RET_ReallyLR implicit $x0
267 name: freeze_mul_fold_barrier
272 ; CHECK-LABEL: name: freeze_mul_fold_barrier
273 ; CHECK: liveins: $w0
275 ; CHECK-NEXT: %cst:_(s64) = G_CONSTANT i64 9
276 ; CHECK-NEXT: %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
277 ; CHECK-NEXT: [[MUL:%[0-9]+]]:_(s64) = G_MUL %c, %c
278 ; CHECK-NEXT: $x0 = COPY [[MUL]](s64)
279 ; CHECK-NEXT: RET_ReallyLR implicit $x0
281 %cst:_(s64) = G_CONSTANT i64 9
282 %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
283 %1:_(s64) = G_MUL %c, %c
284 %2:_(s64) = G_FREEZE %1
286 RET_ReallyLR implicit $x0
289 name: freeze_nsw_mul_fold_barrier
294 ; CHECK-LABEL: name: freeze_nsw_mul_fold_barrier
295 ; CHECK: liveins: $w0
297 ; CHECK-NEXT: %cst:_(s64) = G_CONSTANT i64 9
298 ; CHECK-NEXT: %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
299 ; CHECK-NEXT: [[MUL:%[0-9]+]]:_(s64) = G_MUL %c, %c
300 ; CHECK-NEXT: $x0 = COPY [[MUL]](s64)
301 ; CHECK-NEXT: RET_ReallyLR implicit $x0
303 %cst:_(s64) = G_CONSTANT i64 9
304 %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
305 %1:_(s64) = nsw G_MUL %c, %c
306 %2:_(s64) = G_FREEZE %1
308 RET_ReallyLR implicit $x0
311 name: freeze_trunc_fold_barrier
316 ; CHECK-LABEL: name: freeze_trunc_fold_barrier
317 ; CHECK: liveins: $w0
319 ; CHECK-NEXT: %cst:_(s64) = G_CONSTANT i64 9
320 ; CHECK-NEXT: %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
321 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC %c(s64)
322 ; CHECK-NEXT: $w0 = COPY [[TRUNC]](s32)
323 ; CHECK-NEXT: RET_ReallyLR implicit $q0
325 %cst:_(s64) = G_CONSTANT i64 9
326 %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
327 %1:_(s32) = G_TRUNC %c
328 %2:_(s32) = G_FREEZE %1
330 RET_ReallyLR implicit $q0
333 name: freeze_nuw_trunc_fold_barrier
338 ; CHECK-LABEL: name: freeze_nuw_trunc_fold_barrier
339 ; CHECK: liveins: $w0
341 ; CHECK-NEXT: %cst:_(s64) = G_CONSTANT i64 9
342 ; CHECK-NEXT: %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
343 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC %c(s64)
344 ; CHECK-NEXT: $w0 = COPY [[TRUNC]](s32)
345 ; CHECK-NEXT: RET_ReallyLR implicit $q0
347 %cst:_(s64) = G_CONSTANT i64 9
348 %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
349 %1:_(s32) = nuw G_TRUNC %c
350 %2:_(s32) = G_FREEZE %1
352 RET_ReallyLR implicit $q0
355 name: freeze_add_fold_barrier
360 ; CHECK-LABEL: name: freeze_add_fold_barrier
361 ; CHECK: liveins: $w0
363 ; CHECK-NEXT: %cst:_(s64) = G_CONSTANT i64 9
364 ; CHECK-NEXT: %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
365 ; CHECK-NEXT: [[ADD:%[0-9]+]]:_(s64) = G_ADD %c, %c
366 ; CHECK-NEXT: $x0 = COPY [[ADD]](s64)
367 ; CHECK-NEXT: RET_ReallyLR implicit $x0
369 %cst:_(s64) = G_CONSTANT i64 9
370 %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
371 %1:_(s64) = G_ADD %c, %c
372 %2:_(s64) = G_FREEZE %1
374 RET_ReallyLR implicit $x0
377 name: freeze_nuw_add_fold_barrier
382 ; CHECK-LABEL: name: freeze_nuw_add_fold_barrier
383 ; CHECK: liveins: $w0
385 ; CHECK-NEXT: %cst:_(s64) = G_CONSTANT i64 9
386 ; CHECK-NEXT: %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
387 ; CHECK-NEXT: [[ADD:%[0-9]+]]:_(s64) = G_ADD %c, %c
388 ; CHECK-NEXT: $x0 = COPY [[ADD]](s64)
389 ; CHECK-NEXT: RET_ReallyLR implicit $x0
391 %cst:_(s64) = G_CONSTANT i64 9
392 %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
393 %1:_(s64) = nuw G_ADD %c, %c
394 %2:_(s64) = G_FREEZE %1
396 RET_ReallyLR implicit $x0
399 name: freeze_xor_fold_barrier
404 ; CHECK-LABEL: name: freeze_xor_fold_barrier
405 ; CHECK: liveins: $w0
407 ; CHECK-NEXT: %cst:_(s64) = G_CONSTANT i64 9
408 ; CHECK-NEXT: %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
409 ; CHECK-NEXT: [[XOR:%[0-9]+]]:_(s64) = G_XOR %c, %c
410 ; CHECK-NEXT: $x0 = COPY [[XOR]](s64)
411 ; CHECK-NEXT: RET_ReallyLR implicit $x0
413 %cst:_(s64) = G_CONSTANT i64 9
414 %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
415 %1:_(s64) = G_XOR %c, %c
416 %2:_(s64) = G_FREEZE %1
418 RET_ReallyLR implicit $x0
421 name: freeze_fptosi_fold_barrier
426 ; CHECK-LABEL: name: freeze_fptosi_fold_barrier
427 ; CHECK: liveins: $w0
429 ; CHECK-NEXT: %cst:_(s64) = G_CONSTANT i64 9
430 ; CHECK-NEXT: %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
431 ; CHECK-NEXT: [[FPTOSI:%[0-9]+]]:_(s64) = G_FPTOSI %c(s64)
432 ; CHECK-NEXT: [[FREEZE:%[0-9]+]]:_(s64) = G_FREEZE [[FPTOSI]]
433 ; CHECK-NEXT: $x0 = COPY [[FREEZE]](s64)
434 ; CHECK-NEXT: RET_ReallyLR implicit $x0
436 %cst:_(s64) = G_CONSTANT i64 9
437 %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
438 %1:_(s64) = G_FPTOSI %c
439 %2:_(s64) = G_FREEZE %1
441 RET_ReallyLR implicit $x0
444 name: freeze_fptoui_fold_barrier
449 ; CHECK-LABEL: name: freeze_fptoui_fold_barrier
450 ; CHECK: liveins: $w0
452 ; CHECK-NEXT: %cst:_(s64) = G_CONSTANT i64 9
453 ; CHECK-NEXT: %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
454 ; CHECK-NEXT: [[FPTOUI:%[0-9]+]]:_(s64) = G_FPTOUI %c(s64)
455 ; CHECK-NEXT: [[FREEZE:%[0-9]+]]:_(s64) = G_FREEZE [[FPTOUI]]
456 ; CHECK-NEXT: $x0 = COPY [[FREEZE]](s64)
457 ; CHECK-NEXT: RET_ReallyLR implicit $x0
459 %cst:_(s64) = G_CONSTANT i64 9
460 %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
461 %1:_(s64) = G_FPTOUI %c
462 %2:_(s64) = G_FREEZE %1
464 RET_ReallyLR implicit $x0
467 name: freeze_shl_fold_barrier
472 ; CHECK-LABEL: name: freeze_shl_fold_barrier
473 ; CHECK: liveins: $w0
475 ; CHECK-NEXT: %cst:_(s64) = G_CONSTANT i64 9
476 ; CHECK-NEXT: %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
477 ; CHECK-NEXT: [[SHL:%[0-9]+]]:_(s64) = G_SHL %c, %c(s64)
478 ; CHECK-NEXT: [[FREEZE:%[0-9]+]]:_(s64) = G_FREEZE [[SHL]]
479 ; CHECK-NEXT: $x0 = COPY [[FREEZE]](s64)
480 ; CHECK-NEXT: RET_ReallyLR implicit $x0
482 %cst:_(s64) = G_CONSTANT i64 9
483 %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
484 %1:_(s64) = G_SHL %c, %c
485 %2:_(s64) = G_FREEZE %1
487 RET_ReallyLR implicit $x0
490 name: freeze_ashr_fold_barrier
495 ; CHECK-LABEL: name: freeze_ashr_fold_barrier
496 ; CHECK: liveins: $w0
498 ; CHECK-NEXT: %cst:_(s64) = G_CONSTANT i64 9
499 ; CHECK-NEXT: %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
500 ; CHECK-NEXT: [[ASHR:%[0-9]+]]:_(s64) = G_ASHR %c, %c(s64)
501 ; CHECK-NEXT: [[FREEZE:%[0-9]+]]:_(s64) = G_FREEZE [[ASHR]]
502 ; CHECK-NEXT: $x0 = COPY [[FREEZE]](s64)
503 ; CHECK-NEXT: RET_ReallyLR implicit $x0
505 %cst:_(s64) = G_CONSTANT i64 9
506 %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
507 %1:_(s64) = G_ASHR %c, %c
508 %2:_(s64) = G_FREEZE %1
510 RET_ReallyLR implicit $x0
513 name: freeze_lshr_fold_barrier
518 ; CHECK-LABEL: name: freeze_lshr_fold_barrier
519 ; CHECK: liveins: $w0
521 ; CHECK-NEXT: %cst:_(s64) = G_CONSTANT i64 9
522 ; CHECK-NEXT: %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
523 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(s64) = G_LSHR %c, %c(s64)
524 ; CHECK-NEXT: [[FREEZE:%[0-9]+]]:_(s64) = G_FREEZE [[LSHR]]
525 ; CHECK-NEXT: $x0 = COPY [[FREEZE]](s64)
526 ; CHECK-NEXT: RET_ReallyLR implicit $x0
528 %cst:_(s64) = G_CONSTANT i64 9
529 %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
530 %1:_(s64) = G_LSHR %c, %c
531 %2:_(s64) = G_FREEZE %1
533 RET_ReallyLR implicit $x0
536 name: freeze_ctlz_fold_barrier
541 ; CHECK-LABEL: name: freeze_ctlz_fold_barrier
542 ; CHECK: liveins: $w0
544 ; CHECK-NEXT: %cst:_(s64) = G_CONSTANT i64 9
545 ; CHECK-NEXT: %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
546 ; CHECK-NEXT: [[CTLZ:%[0-9]+]]:_(s64) = G_CTLZ %c(s64)
547 ; CHECK-NEXT: $x0 = COPY [[CTLZ]](s64)
548 ; CHECK-NEXT: RET_ReallyLR implicit $x0
550 %cst:_(s64) = G_CONSTANT i64 9
551 %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
552 %1:_(s64) = G_CTLZ %c
553 %2:_(s64) = G_FREEZE %1
555 RET_ReallyLR implicit $x0
558 name: freeze_cttz_fold_barrier
563 ; CHECK-LABEL: name: freeze_cttz_fold_barrier
564 ; CHECK: liveins: $w0
566 ; CHECK-NEXT: %cst:_(s64) = G_CONSTANT i64 9
567 ; CHECK-NEXT: %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
568 ; CHECK-NEXT: [[CTTZ:%[0-9]+]]:_(s64) = G_CTTZ %c(s64)
569 ; CHECK-NEXT: $x0 = COPY [[CTTZ]](s64)
570 ; CHECK-NEXT: RET_ReallyLR implicit $x0
572 %cst:_(s64) = G_CONSTANT i64 9
573 %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
574 %1:_(s64) = G_CTTZ %c
575 %2:_(s64) = G_FREEZE %1
577 RET_ReallyLR implicit $x0
580 name: freeze_abs_fold_barrier
585 ; CHECK-LABEL: name: freeze_abs_fold_barrier
586 ; CHECK: liveins: $w0
588 ; CHECK-NEXT: %cst:_(s64) = G_CONSTANT i64 9
589 ; CHECK-NEXT: %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
590 ; CHECK-NEXT: [[ABS:%[0-9]+]]:_(s64) = G_ABS %c
591 ; CHECK-NEXT: $x0 = COPY [[ABS]](s64)
592 ; CHECK-NEXT: RET_ReallyLR implicit $x0
594 %cst:_(s64) = G_CONSTANT i64 9
595 %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
597 %2:_(s64) = G_FREEZE %1
599 RET_ReallyLR implicit $x0
602 name: freeze_bswap_fold_barrier
607 ; CHECK-LABEL: name: freeze_bswap_fold_barrier
608 ; CHECK: liveins: $w0
610 ; CHECK-NEXT: %cst:_(s64) = G_CONSTANT i64 9
611 ; CHECK-NEXT: %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
612 ; CHECK-NEXT: [[BSWAP:%[0-9]+]]:_(s64) = G_BSWAP %c
613 ; CHECK-NEXT: $x0 = COPY [[BSWAP]](s64)
614 ; CHECK-NEXT: RET_ReallyLR implicit $x0
616 %cst:_(s64) = G_CONSTANT i64 9
617 %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
618 %1:_(s64) = G_BSWAP %c
619 %2:_(s64) = G_FREEZE %1
621 RET_ReallyLR implicit $x0
624 name: freeze_bitreverse_fold_barrier
629 ; CHECK-LABEL: name: freeze_bitreverse_fold_barrier
630 ; CHECK: liveins: $w0
632 ; CHECK-NEXT: %cst:_(s64) = G_CONSTANT i64 9
633 ; CHECK-NEXT: %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
634 ; CHECK-NEXT: [[BITREVERSE:%[0-9]+]]:_(s64) = G_BITREVERSE %c
635 ; CHECK-NEXT: $x0 = COPY [[BITREVERSE]](s64)
636 ; CHECK-NEXT: RET_ReallyLR implicit $x0
638 %cst:_(s64) = G_CONSTANT i64 9
639 %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
640 %1:_(s64) = G_BITREVERSE %c
641 %2:_(s64) = G_FREEZE %1
643 RET_ReallyLR implicit $x0
646 name: freeze_icmp_fold_barrier
651 ; CHECK-LABEL: name: freeze_icmp_fold_barrier
652 ; CHECK: liveins: $w0
654 ; CHECK-NEXT: %cst:_(s64) = G_CONSTANT i64 9
655 ; CHECK-NEXT: %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
656 ; CHECK-NEXT: %d:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
657 ; CHECK-NEXT: %cmp:_(s1) = G_ICMP intpred(eq), %c(s64), %d
658 ; CHECK-NEXT: %ext:_(s64) = G_ZEXT %cmp(s1)
659 ; CHECK-NEXT: $x0 = COPY %ext(s64)
660 ; CHECK-NEXT: RET_ReallyLR implicit $x0
662 %cst:_(s64) = G_CONSTANT i64 9
663 %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
664 %d:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
665 %cmp:_(s1) = G_ICMP intpred(eq), %c(s64), %d
666 %2:_(s1) = G_FREEZE %cmp
667 %ext:_(s64) = G_ZEXT %2(s1)
669 RET_ReallyLR implicit $x0
672 name: freeze_fcmp_fold_barrier
677 ; CHECK-LABEL: name: freeze_fcmp_fold_barrier
678 ; CHECK: liveins: $w0
680 ; CHECK-NEXT: %cst:_(s64) = G_CONSTANT i64 9
681 ; CHECK-NEXT: %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
682 ; CHECK-NEXT: %d:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
683 ; CHECK-NEXT: %cmp:_(s1) = G_FCMP floatpred(oeq), %c(s64), %d
684 ; CHECK-NEXT: %ext:_(s64) = G_ZEXT %cmp(s1)
685 ; CHECK-NEXT: $x0 = COPY %ext(s64)
686 ; CHECK-NEXT: RET_ReallyLR implicit $x0
688 %cst:_(s64) = G_CONSTANT i64 9
689 %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
690 %d:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
691 %cmp:_(s1) = G_FCMP floatpred(oeq), %c(s64), %d
692 %2:_(s1) = G_FREEZE %cmp
693 %ext:_(s64) = G_ZEXT %2(s1)
695 RET_ReallyLR implicit $x0
698 name: freeze_fshl_fold_barrier
703 ; CHECK-LABEL: name: freeze_fshl_fold_barrier
704 ; CHECK: liveins: $w0
706 ; CHECK-NEXT: %cst:_(s64) = G_CONSTANT i64 9
707 ; CHECK-NEXT: %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
708 ; CHECK-NEXT: [[ROTL:%[0-9]+]]:_(s64) = G_ROTL %c, %c(s64)
709 ; CHECK-NEXT: [[FREEZE:%[0-9]+]]:_(s64) = G_FREEZE [[ROTL]]
710 ; CHECK-NEXT: $x0 = COPY [[FREEZE]](s64)
711 ; CHECK-NEXT: RET_ReallyLR implicit $x0
713 %cst:_(s64) = G_CONSTANT i64 9
714 %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
715 %1:_(s64) = G_FSHL %c, %c, %c
716 %2:_(s64) = G_FREEZE %1
718 RET_ReallyLR implicit $x0
721 name: freeze_fshr_fold_barrier
726 ; CHECK-LABEL: name: freeze_fshr_fold_barrier
727 ; CHECK: liveins: $w0
729 ; CHECK-NEXT: %cst:_(s64) = G_CONSTANT i64 9
730 ; CHECK-NEXT: %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
731 ; CHECK-NEXT: [[ROTR:%[0-9]+]]:_(s64) = G_ROTR %c, %c(s64)
732 ; CHECK-NEXT: [[FREEZE:%[0-9]+]]:_(s64) = G_FREEZE [[ROTR]]
733 ; CHECK-NEXT: $x0 = COPY [[FREEZE]](s64)
734 ; CHECK-NEXT: RET_ReallyLR implicit $x0
736 %cst:_(s64) = G_CONSTANT i64 9
737 %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
738 %1:_(s64) = G_FSHR %c, %c, %c
739 %2:_(s64) = G_FREEZE %1
741 RET_ReallyLR implicit $x0
744 name: freeze_smax_fold_barrier
749 ; CHECK-LABEL: name: freeze_smax_fold_barrier
750 ; CHECK: liveins: $w0
752 ; CHECK-NEXT: %cst:_(s64) = G_CONSTANT i64 9
753 ; CHECK-NEXT: %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
754 ; CHECK-NEXT: %d:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
755 ; CHECK-NEXT: [[SMAX:%[0-9]+]]:_(s64) = G_SMAX %c, %d
756 ; CHECK-NEXT: $x0 = COPY [[SMAX]](s64)
757 ; CHECK-NEXT: RET_ReallyLR implicit $x0
759 %cst:_(s64) = G_CONSTANT i64 9
760 %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
761 %d:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
762 %1:_(s64) = G_SMAX %c, %d
763 %2:_(s64) = G_FREEZE %1
765 RET_ReallyLR implicit $x0
768 name: freeze_smin_fold_barrier
773 ; CHECK-LABEL: name: freeze_smin_fold_barrier
774 ; CHECK: liveins: $w0
776 ; CHECK-NEXT: %cst:_(s64) = G_CONSTANT i64 9
777 ; CHECK-NEXT: %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
778 ; CHECK-NEXT: %d:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
779 ; CHECK-NEXT: [[SMIN:%[0-9]+]]:_(s64) = G_SMIN %c, %d
780 ; CHECK-NEXT: $x0 = COPY [[SMIN]](s64)
781 ; CHECK-NEXT: RET_ReallyLR implicit $x0
783 %cst:_(s64) = G_CONSTANT i64 9
784 %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
785 %d:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
786 %1:_(s64) = G_SMIN %c, %d
787 %2:_(s64) = G_FREEZE %1
789 RET_ReallyLR implicit $x0
792 name: freeze_umax_fold_barrier
797 ; CHECK-LABEL: name: freeze_umax_fold_barrier
798 ; CHECK: liveins: $w0
800 ; CHECK-NEXT: %cst:_(s64) = G_CONSTANT i64 9
801 ; CHECK-NEXT: %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
802 ; CHECK-NEXT: %d:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
803 ; CHECK-NEXT: [[UMAX:%[0-9]+]]:_(s64) = G_UMAX %c, %d
804 ; CHECK-NEXT: $x0 = COPY [[UMAX]](s64)
805 ; CHECK-NEXT: RET_ReallyLR implicit $x0
807 %cst:_(s64) = G_CONSTANT i64 9
808 %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
809 %d:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
810 %1:_(s64) = G_UMAX %c, %d
811 %2:_(s64) = G_FREEZE %1
813 RET_ReallyLR implicit $x0
816 name: freeze_umin_fold_barrier
821 ; CHECK-LABEL: name: freeze_umin_fold_barrier
822 ; CHECK: liveins: $w0
824 ; CHECK-NEXT: %cst:_(s64) = G_CONSTANT i64 9
825 ; CHECK-NEXT: %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
826 ; CHECK-NEXT: %d:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
827 ; CHECK-NEXT: [[UMIN:%[0-9]+]]:_(s64) = G_UMIN %c, %d
828 ; CHECK-NEXT: $x0 = COPY [[UMIN]](s64)
829 ; CHECK-NEXT: RET_ReallyLR implicit $x0
831 %cst:_(s64) = G_CONSTANT i64 9
832 %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
833 %d:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
834 %1:_(s64) = G_UMIN %c, %d
835 %2:_(s64) = G_FREEZE %1
837 RET_ReallyLR implicit $x0
840 name: freeze_ptrmask_fold_barrier
845 ; CHECK-LABEL: name: freeze_ptrmask_fold_barrier
846 ; CHECK: liveins: $w0
848 ; CHECK-NEXT: %p:_(p0) = COPY $x0
849 ; CHECK-NEXT: %cst:_(s64) = G_CONSTANT i64 9
850 ; CHECK-NEXT: [[FREEZE:%[0-9]+]]:_(p0) = G_FREEZE %p
851 ; CHECK-NEXT: [[PTRMASK:%[0-9]+]]:_(p0) = G_PTRMASK [[FREEZE]], %cst(s64)
852 ; CHECK-NEXT: $x0 = COPY [[PTRMASK]](p0)
853 ; CHECK-NEXT: RET_ReallyLR implicit $x0
856 %cst:_(s64) = G_CONSTANT i64 9
857 %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
858 %d:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
859 %1:_(p0) = G_PTRMASK %p, %cst
860 %2:_(p0) = G_FREEZE %1
862 RET_ReallyLR implicit $x0
865 name: freeze_saddo_fold_barrier
870 ; CHECK-LABEL: name: freeze_saddo_fold_barrier
871 ; CHECK: liveins: $w0
873 ; CHECK-NEXT: %cst:_(s64) = G_CONSTANT i64 9
874 ; CHECK-NEXT: %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
875 ; CHECK-NEXT: %d:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
876 ; CHECK-NEXT: [[ADD:%[0-9]+]]:_(s64) = G_ADD %c, %d
877 ; CHECK-NEXT: $x0 = COPY [[ADD]](s64)
878 ; CHECK-NEXT: RET_ReallyLR implicit $x0
880 %cst:_(s64) = G_CONSTANT i64 9
881 %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
882 %d:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
883 %1:_(s64), %o:_(s1) = G_SADDO %c, %d
884 %2:_(s64) = G_FREEZE %1
886 RET_ReallyLR implicit $x0
889 name: freeze_ssubo_fold_barrier
894 ; CHECK-LABEL: name: freeze_ssubo_fold_barrier
895 ; CHECK: liveins: $w0
897 ; CHECK-NEXT: %cst:_(s64) = G_CONSTANT i64 9
898 ; CHECK-NEXT: %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
899 ; CHECK-NEXT: %d:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
900 ; CHECK-NEXT: %4:_(s64), %o:_(s1) = G_SSUBO %c, %d
901 ; CHECK-NEXT: $x0 = COPY %4(s64)
902 ; CHECK-NEXT: RET_ReallyLR implicit $x0
904 %cst:_(s64) = G_CONSTANT i64 9
905 %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
906 %d:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
907 %1:_(s64), %o:_(s1) = G_SSUBO %c, %d
908 %2:_(s64) = G_FREEZE %1
910 RET_ReallyLR implicit $x0
913 name: freeze_uaddo_fold_barrier
918 ; CHECK-LABEL: name: freeze_uaddo_fold_barrier
919 ; CHECK: liveins: $w0
921 ; CHECK-NEXT: %cst:_(s64) = G_CONSTANT i64 9
922 ; CHECK-NEXT: %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
923 ; CHECK-NEXT: %d:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
924 ; CHECK-NEXT: [[ADD:%[0-9]+]]:_(s64) = G_ADD %c, %d
925 ; CHECK-NEXT: $x0 = COPY [[ADD]](s64)
926 ; CHECK-NEXT: RET_ReallyLR implicit $x0
928 %cst:_(s64) = G_CONSTANT i64 9
929 %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
930 %d:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
931 %1:_(s64), %o:_(s1) = G_UADDO %c, %d
932 %2:_(s64) = G_FREEZE %1
934 RET_ReallyLR implicit $x0
937 name: freeze_usubo_fold_barrier
942 ; CHECK-LABEL: name: freeze_usubo_fold_barrier
943 ; CHECK: liveins: $w0
945 ; CHECK-NEXT: %cst:_(s64) = G_CONSTANT i64 9
946 ; CHECK-NEXT: %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
947 ; CHECK-NEXT: %d:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
948 ; CHECK-NEXT: %4:_(s64), %o:_(s1) = G_USUBO %c, %d
949 ; CHECK-NEXT: $x0 = COPY %4(s64)
950 ; CHECK-NEXT: RET_ReallyLR implicit $x0
952 %cst:_(s64) = G_CONSTANT i64 9
953 %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
954 %d:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
955 %1:_(s64), %o:_(s1) = G_USUBO %c, %d
956 %2:_(s64) = G_FREEZE %1
958 RET_ReallyLR implicit $x0
961 name: freeze_smulo_fold_barrier
966 ; CHECK-LABEL: name: freeze_smulo_fold_barrier
967 ; CHECK: liveins: $w0
969 ; CHECK-NEXT: %cst:_(s64) = G_CONSTANT i64 9
970 ; CHECK-NEXT: %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
971 ; CHECK-NEXT: %d:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
972 ; CHECK-NEXT: %4:_(s64), %o:_(s1) = G_SMULO %c, %d
973 ; CHECK-NEXT: $x0 = COPY %4(s64)
974 ; CHECK-NEXT: RET_ReallyLR implicit $x0
976 %cst:_(s64) = G_CONSTANT i64 9
977 %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
978 %d:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
979 %1:_(s64), %o:_(s1) = G_SMULO %c, %d
980 %2:_(s64) = G_FREEZE %1
982 RET_ReallyLR implicit $x0
985 name: freeze_umulo_fold_barrier
990 ; CHECK-LABEL: name: freeze_umulo_fold_barrier
991 ; CHECK: liveins: $w0
993 ; CHECK-NEXT: %cst:_(s64) = G_CONSTANT i64 9
994 ; CHECK-NEXT: %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
995 ; CHECK-NEXT: %d:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
996 ; CHECK-NEXT: %4:_(s64), %o:_(s1) = G_UMULO %c, %d
997 ; CHECK-NEXT: $x0 = COPY %4(s64)
998 ; CHECK-NEXT: RET_ReallyLR implicit $x0
1000 %cst:_(s64) = G_CONSTANT i64 9
1001 %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
1002 %d:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
1003 %1:_(s64), %o:_(s1) = G_UMULO %c, %d
1004 %2:_(s64) = G_FREEZE %1
1006 RET_ReallyLR implicit $x0
1009 name: freeze_saddsat_fold_barrier
1014 ; CHECK-LABEL: name: freeze_saddsat_fold_barrier
1015 ; CHECK: liveins: $w0
1016 ; CHECK-NEXT: {{ $}}
1017 ; CHECK-NEXT: %cst:_(s64) = G_CONSTANT i64 9
1018 ; CHECK-NEXT: %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
1019 ; CHECK-NEXT: %d:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
1020 ; CHECK-NEXT: [[SADDSAT:%[0-9]+]]:_(s64) = G_SADDSAT %c, %d
1021 ; CHECK-NEXT: $x0 = COPY [[SADDSAT]](s64)
1022 ; CHECK-NEXT: RET_ReallyLR implicit $x0
1023 %0:_(s64) = COPY $x0
1024 %cst:_(s64) = G_CONSTANT i64 9
1025 %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
1026 %d:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
1027 %1:_(s64) = G_SADDSAT %c, %d
1028 %2:_(s64) = G_FREEZE %1
1030 RET_ReallyLR implicit $x0
1033 name: freeze_uaddsat_fold_barrier
1038 ; CHECK-LABEL: name: freeze_uaddsat_fold_barrier
1039 ; CHECK: liveins: $w0
1040 ; CHECK-NEXT: {{ $}}
1041 ; CHECK-NEXT: %cst:_(s64) = G_CONSTANT i64 9
1042 ; CHECK-NEXT: %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
1043 ; CHECK-NEXT: %d:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
1044 ; CHECK-NEXT: [[UADDSAT:%[0-9]+]]:_(s64) = G_UADDSAT %c, %d
1045 ; CHECK-NEXT: $x0 = COPY [[UADDSAT]](s64)
1046 ; CHECK-NEXT: RET_ReallyLR implicit $x0
1047 %0:_(s64) = COPY $x0
1048 %cst:_(s64) = G_CONSTANT i64 9
1049 %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
1050 %d:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
1051 %1:_(s64) = G_UADDSAT %c, %d
1052 %2:_(s64) = G_FREEZE %1
1054 RET_ReallyLR implicit $x0
1057 name: freeze_ssubsat_fold_barrier
1062 ; CHECK-LABEL: name: freeze_ssubsat_fold_barrier
1063 ; CHECK: liveins: $w0
1064 ; CHECK-NEXT: {{ $}}
1065 ; CHECK-NEXT: %cst:_(s64) = G_CONSTANT i64 9
1066 ; CHECK-NEXT: %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
1067 ; CHECK-NEXT: %d:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
1068 ; CHECK-NEXT: [[SSUBSAT:%[0-9]+]]:_(s64) = G_SSUBSAT %c, %d
1069 ; CHECK-NEXT: $x0 = COPY [[SSUBSAT]](s64)
1070 ; CHECK-NEXT: RET_ReallyLR implicit $x0
1071 %0:_(s64) = COPY $x0
1072 %cst:_(s64) = G_CONSTANT i64 9
1073 %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
1074 %d:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
1075 %1:_(s64) = G_SSUBSAT %c, %d
1076 %2:_(s64) = G_FREEZE %1
1078 RET_ReallyLR implicit $x0
1081 name: freeze_usubsat_fold_barrier
1086 ; CHECK-LABEL: name: freeze_usubsat_fold_barrier
1087 ; CHECK: liveins: $w0
1088 ; CHECK-NEXT: {{ $}}
1089 ; CHECK-NEXT: %cst:_(s64) = G_CONSTANT i64 9
1090 ; CHECK-NEXT: %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
1091 ; CHECK-NEXT: %d:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
1092 ; CHECK-NEXT: [[USUBSAT:%[0-9]+]]:_(s64) = G_USUBSAT %c, %d
1093 ; CHECK-NEXT: $x0 = COPY [[USUBSAT]](s64)
1094 ; CHECK-NEXT: RET_ReallyLR implicit $x0
1095 %0:_(s64) = COPY $x0
1096 %cst:_(s64) = G_CONSTANT i64 9
1097 %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
1098 %d:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
1099 %1:_(s64) = G_USUBSAT %c, %d
1100 %2:_(s64) = G_FREEZE %1
1102 RET_ReallyLR implicit $x0
1105 name: freeze_sshlsat_fold_barrier
1110 ; CHECK-LABEL: name: freeze_sshlsat_fold_barrier
1111 ; CHECK: liveins: $w0
1112 ; CHECK-NEXT: {{ $}}
1113 ; CHECK-NEXT: %cst:_(s64) = G_CONSTANT i64 9
1114 ; CHECK-NEXT: %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
1115 ; CHECK-NEXT: %d:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
1116 ; CHECK-NEXT: [[SSHLSAT:%[0-9]+]]:_(s64) = G_SSHLSAT %c, %d(s64)
1117 ; CHECK-NEXT: [[FREEZE:%[0-9]+]]:_(s64) = G_FREEZE [[SSHLSAT]]
1118 ; CHECK-NEXT: $x0 = COPY [[FREEZE]](s64)
1119 ; CHECK-NEXT: RET_ReallyLR implicit $x0
1120 %0:_(s64) = COPY $x0
1121 %cst:_(s64) = G_CONSTANT i64 9
1122 %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
1123 %d:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
1124 %1:_(s64) = G_SSHLSAT %c, %d
1125 %2:_(s64) = G_FREEZE %1
1127 RET_ReallyLR implicit $x0
1130 name: freeze_ushlsat_fold_barrier
1135 ; CHECK-LABEL: name: freeze_ushlsat_fold_barrier
1136 ; CHECK: liveins: $w0
1137 ; CHECK-NEXT: {{ $}}
1138 ; CHECK-NEXT: %cst:_(s64) = G_CONSTANT i64 9
1139 ; CHECK-NEXT: %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
1140 ; CHECK-NEXT: %d:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
1141 ; CHECK-NEXT: [[USHLSAT:%[0-9]+]]:_(s64) = G_USHLSAT %c, %d(s64)
1142 ; CHECK-NEXT: [[FREEZE:%[0-9]+]]:_(s64) = G_FREEZE [[USHLSAT]]
1143 ; CHECK-NEXT: $x0 = COPY [[FREEZE]](s64)
1144 ; CHECK-NEXT: RET_ReallyLR implicit $x0
1145 %0:_(s64) = COPY $x0
1146 %cst:_(s64) = G_CONSTANT i64 9
1147 %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
1148 %d:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
1149 %1:_(s64) = G_USHLSAT %c, %d
1150 %2:_(s64) = G_FREEZE %1
1152 RET_ReallyLR implicit $x0
1155 name: freeze_fneg_fold_barrier
1160 ; CHECK-LABEL: name: freeze_fneg_fold_barrier
1161 ; CHECK: liveins: $w0
1162 ; CHECK-NEXT: {{ $}}
1163 ; CHECK-NEXT: %cst:_(s64) = G_FCONSTANT double 0.000000e+00
1164 ; CHECK-NEXT: %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
1165 ; CHECK-NEXT: [[FNEG:%[0-9]+]]:_(s64) = G_FNEG %c
1166 ; CHECK-NEXT: $x0 = COPY [[FNEG]](s64)
1167 ; CHECK-NEXT: RET_ReallyLR implicit $x0
1168 %0:_(s64) = COPY $x0
1169 %cst:_(s64) = G_FCONSTANT double 0.0
1170 %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
1171 %d:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
1172 %1:_(s64) = G_FNEG %c
1173 %2:_(s64) = G_FREEZE %1
1175 RET_ReallyLR implicit $x0
1178 name: freeze_frem_fold_barrier
1183 ; CHECK-LABEL: name: freeze_frem_fold_barrier
1184 ; CHECK: liveins: $w0
1185 ; CHECK-NEXT: {{ $}}
1186 ; CHECK-NEXT: %cst:_(s64) = G_FCONSTANT double 0.000000e+00
1187 ; CHECK-NEXT: %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
1188 ; CHECK-NEXT: %d:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
1189 ; CHECK-NEXT: [[FREM:%[0-9]+]]:_(s64) = G_FREM %c, %d
1190 ; CHECK-NEXT: $x0 = COPY [[FREM]](s64)
1191 ; CHECK-NEXT: RET_ReallyLR implicit $x0
1192 %0:_(s64) = COPY $x0
1193 %cst:_(s64) = G_FCONSTANT double 0.0
1194 %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
1195 %d:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
1196 %1:_(s64) = G_FREM %c, %d
1197 %2:_(s64) = G_FREEZE %1
1199 RET_ReallyLR implicit $x0
1202 name: freeze_fdiv_fold_barrier
1207 ; CHECK-LABEL: name: freeze_fdiv_fold_barrier
1208 ; CHECK: liveins: $w0
1209 ; CHECK-NEXT: {{ $}}
1210 ; CHECK-NEXT: %cst:_(s64) = G_FCONSTANT double 0.000000e+00
1211 ; CHECK-NEXT: %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
1212 ; CHECK-NEXT: %d:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
1213 ; CHECK-NEXT: [[FDIV:%[0-9]+]]:_(s64) = G_FDIV %c, %d
1214 ; CHECK-NEXT: $x0 = COPY [[FDIV]](s64)
1215 ; CHECK-NEXT: RET_ReallyLR implicit $x0
1216 %0:_(s64) = COPY $x0
1217 %cst:_(s64) = G_FCONSTANT double 0.0
1218 %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
1219 %d:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
1220 %1:_(s64) = G_FDIV %c, %d
1221 %2:_(s64) = G_FREEZE %1
1223 RET_ReallyLR implicit $x0
1226 name: freeze_fmul_fold_barrier
1231 ; CHECK-LABEL: name: freeze_fmul_fold_barrier
1232 ; CHECK: liveins: $w0
1233 ; CHECK-NEXT: {{ $}}
1234 ; CHECK-NEXT: %cst:_(s64) = G_FCONSTANT double 0.000000e+00
1235 ; CHECK-NEXT: %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
1236 ; CHECK-NEXT: %d:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
1237 ; CHECK-NEXT: [[FMUL:%[0-9]+]]:_(s64) = G_FMUL %c, %d
1238 ; CHECK-NEXT: $x0 = COPY [[FMUL]](s64)
1239 ; CHECK-NEXT: RET_ReallyLR implicit $x0
1240 %0:_(s64) = COPY $x0
1241 %cst:_(s64) = G_FCONSTANT double 0.0
1242 %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
1243 %d:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
1244 %1:_(s64) = G_FMUL %c, %d
1245 %2:_(s64) = G_FREEZE %1
1247 RET_ReallyLR implicit $x0
1250 name: freeze_fsub_fold_barrier
1255 ; CHECK-LABEL: name: freeze_fsub_fold_barrier
1256 ; CHECK: liveins: $w0
1257 ; CHECK-NEXT: {{ $}}
1258 ; CHECK-NEXT: %cst:_(s64) = G_FCONSTANT double 0.000000e+00
1259 ; CHECK-NEXT: %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
1260 ; CHECK-NEXT: %d:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
1261 ; CHECK-NEXT: [[FSUB:%[0-9]+]]:_(s64) = G_FSUB %c, %d
1262 ; CHECK-NEXT: $x0 = COPY [[FSUB]](s64)
1263 ; CHECK-NEXT: RET_ReallyLR implicit $x0
1264 %0:_(s64) = COPY $x0
1265 %cst:_(s64) = G_FCONSTANT double 0.0
1266 %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
1267 %d:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
1268 %1:_(s64) = G_FSUB %c, %d
1269 %2:_(s64) = G_FREEZE %1
1271 RET_ReallyLR implicit $x0
1274 name: freeze_fadd_fold_barrier
1279 ; CHECK-LABEL: name: freeze_fadd_fold_barrier
1280 ; CHECK: liveins: $w0
1281 ; CHECK-NEXT: {{ $}}
1282 ; CHECK-NEXT: %cst:_(s64) = G_FCONSTANT double 0.000000e+00
1283 ; CHECK-NEXT: %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
1284 ; CHECK-NEXT: %d:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
1285 ; CHECK-NEXT: [[FADD:%[0-9]+]]:_(s64) = G_FADD %c, %d
1286 ; CHECK-NEXT: $x0 = COPY [[FADD]](s64)
1287 ; CHECK-NEXT: RET_ReallyLR implicit $x0
1288 %0:_(s64) = COPY $x0
1289 %cst:_(s64) = G_FCONSTANT double 0.0
1290 %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
1291 %d:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
1292 %1:_(s64) = G_FADD %c, %d
1293 %2:_(s64) = G_FREEZE %1
1295 RET_ReallyLR implicit $x0
1298 name: freeze_urem_fold_barrier
1303 ; CHECK-LABEL: name: freeze_urem_fold_barrier
1304 ; CHECK: liveins: $w0
1305 ; CHECK-NEXT: {{ $}}
1306 ; CHECK-NEXT: %cst:_(s64) = G_CONSTANT i64 9
1307 ; CHECK-NEXT: %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
1308 ; CHECK-NEXT: %d:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
1309 ; CHECK-NEXT: [[UREM:%[0-9]+]]:_(s64) = G_UREM %c, %d
1310 ; CHECK-NEXT: $x0 = COPY [[UREM]](s64)
1311 ; CHECK-NEXT: RET_ReallyLR implicit $x0
1312 %0:_(s64) = COPY $x0
1313 %cst:_(s64) = G_CONSTANT i64 9
1314 %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
1315 %d:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
1316 %1:_(s64) = G_UREM %c, %d
1317 %2:_(s64) = G_FREEZE %1
1319 RET_ReallyLR implicit $x0
1322 name: freeze_srem_fold_barrier
1327 ; CHECK-LABEL: name: freeze_srem_fold_barrier
1328 ; CHECK: liveins: $w0
1329 ; CHECK-NEXT: {{ $}}
1330 ; CHECK-NEXT: %cst:_(s64) = G_CONSTANT i64 9
1331 ; CHECK-NEXT: %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
1332 ; CHECK-NEXT: %d:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
1333 ; CHECK-NEXT: [[SREM:%[0-9]+]]:_(s64) = G_SREM %c, %d
1334 ; CHECK-NEXT: $x0 = COPY [[SREM]](s64)
1335 ; CHECK-NEXT: RET_ReallyLR implicit $x0
1336 %0:_(s64) = COPY $x0
1337 %cst:_(s64) = G_CONSTANT i64 9
1338 %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
1339 %d:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
1340 %1:_(s64) = G_SREM %c, %d
1341 %2:_(s64) = G_FREEZE %1
1343 RET_ReallyLR implicit $x0
1346 name: freeze_ptradd_fold_barrier
1351 ; CHECK-LABEL: name: freeze_ptradd_fold_barrier
1352 ; CHECK: liveins: $w0
1353 ; CHECK-NEXT: {{ $}}
1354 ; CHECK-NEXT: %p:_(p0) = COPY $x0
1355 ; CHECK-NEXT: %cst:_(s64) = G_CONSTANT i64 9
1356 ; CHECK-NEXT: [[FREEZE:%[0-9]+]]:_(p0) = G_FREEZE %p
1357 ; CHECK-NEXT: [[PTR_ADD:%[0-9]+]]:_(p0) = G_PTR_ADD [[FREEZE]], %cst(s64)
1358 ; CHECK-NEXT: $x0 = COPY [[PTR_ADD]](p0)
1359 ; CHECK-NEXT: RET_ReallyLR implicit $x0
1360 %0:_(s64) = COPY $x0
1362 %cst:_(s64) = G_CONSTANT i64 9
1363 %c:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
1364 %d:_(s64) = G_CONSTANT_FOLD_BARRIER %cst
1365 %1:_(p0) = G_PTR_ADD %p, %cst
1366 %2:_(p0) = G_FREEZE %1
1368 RET_ReallyLR implicit $x0
1371 # select (false, x, y) -> y
1372 name: freeze_select_fold_barrier
1376 ; CHECK-LABEL: name: freeze_select_fold_barrier
1377 ; CHECK: liveins: $x0, $x1
1378 ; CHECK-NEXT: {{ $}}
1379 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x1
1380 ; CHECK-NEXT: [[FREEZE:%[0-9]+]]:_(s64) = G_FREEZE [[COPY]]
1381 ; CHECK-NEXT: $x0 = COPY [[FREEZE]](s64)
1382 %0:_(s64) = COPY $x0
1383 %1:_(s64) = COPY $x1
1384 %2:_(s1) = G_CONSTANT i1 false
1385 %3:_(s64) = G_SELECT %2, %0, %1
1386 %4:_(s64) = G_FREEZE %3
1390 name: freeze_extract_and_shuffle_vector_fold_barrier
1394 ; CHECK-LABEL: name: freeze_extract_and_shuffle_vector_fold_barrier
1395 ; CHECK: liveins: $x0, $x1
1396 ; CHECK-NEXT: {{ $}}
1397 ; CHECK-NEXT: %arg1:_(<4 x s32>) = COPY $q0
1398 ; CHECK-NEXT: %idx:_(s64) = G_CONSTANT i64 0
1399 ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(<4 x s32>) = G_IMPLICIT_DEF
1400 ; CHECK-NEXT: %sv:_(<4 x s32>) = G_SHUFFLE_VECTOR %arg1(<4 x s32>), [[DEF]], shufflemask(3, 0, 0, 0)
1401 ; CHECK-NEXT: %freeze_sv:_(<4 x s32>) = G_FREEZE %sv
1402 ; CHECK-NEXT: %extract:_(s32) = G_EXTRACT_VECTOR_ELT %freeze_sv(<4 x s32>), %idx(s64)
1403 ; CHECK-NEXT: $w0 = COPY %extract(s32)
1404 ; CHECK-NEXT: RET_ReallyLR implicit $x0
1405 %arg1:_(<4 x s32>) = COPY $q0
1406 %arg2:_(<4 x s32>) = COPY $q1
1407 %idx:_(s64) = G_CONSTANT i64 0
1408 %sv:_(<4 x s32>) = G_SHUFFLE_VECTOR %arg1(<4 x s32>), %arg2(<4 x s32>), shufflemask(3, 0, 0, 0)
1409 %freeze_sv:_(<4 x s32>) = G_FREEZE %sv
1410 %extract:_(s32) = G_EXTRACT_VECTOR_ELT %freeze_sv(<4 x s32>), %idx(s64)
1411 %freeze:_(s32) = G_FREEZE %extract
1412 $w0 = COPY %extract(s32)
1413 RET_ReallyLR implicit $x0
1416 name: freeze_insert_and_shuffle_vector_fold_barrier
1420 ; CHECK-LABEL: name: freeze_insert_and_shuffle_vector_fold_barrier
1421 ; CHECK: liveins: $x0, $x1
1422 ; CHECK-NEXT: {{ $}}
1423 ; CHECK-NEXT: %elt:_(s32) = COPY $w0
1424 ; CHECK-NEXT: %arg1:_(<4 x s32>) = COPY $q0
1425 ; CHECK-NEXT: %idx:_(s64) = G_CONSTANT i64 0
1426 ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(<4 x s32>) = G_IMPLICIT_DEF
1427 ; CHECK-NEXT: %sv:_(<4 x s32>) = G_SHUFFLE_VECTOR %arg1(<4 x s32>), [[DEF]], shufflemask(3, 0, 0, 0)
1428 ; CHECK-NEXT: %freeze_sv:_(<4 x s32>) = G_FREEZE %sv
1429 ; CHECK-NEXT: [[FREEZE:%[0-9]+]]:_(s32) = G_FREEZE %elt
1430 ; CHECK-NEXT: %extract:_(<4 x s32>) = G_INSERT_VECTOR_ELT %freeze_sv, [[FREEZE]](s32), %idx(s64)
1431 ; CHECK-NEXT: $q0 = COPY %extract(<4 x s32>)
1432 ; CHECK-NEXT: RET_ReallyLR implicit $x0
1433 %elt:_(s32) = COPY $w0
1434 %arg1:_(<4 x s32>) = COPY $q0
1435 %arg2:_(<4 x s32>) = COPY $q1
1436 %idx:_(s64) = G_CONSTANT i64 0
1437 %sv:_(<4 x s32>) = G_SHUFFLE_VECTOR %arg1(<4 x s32>), %arg2(<4 x s32>), shufflemask(3, 0, 0, 0)
1438 %freeze_sv:_(<4 x s32>) = G_FREEZE %sv
1439 %extract:_(<4 x s32>) = G_INSERT_VECTOR_ELT %freeze_sv(<4 x s32>), %elt(s32), %idx(s64)
1440 %freeze:_(<4 x s32>) = G_FREEZE %extract
1441 $q0 = COPY %freeze(<4 x s32>)
1442 RET_ReallyLR implicit $x0