; CHECK-LABEL: test_atomic_load_umin_i8:
; OUTLINE-ATOMICS-LABEL: test_atomic_load_umin_i8:
; OUTLINE-ATOMICS: // %bb.0:
+; OUTLINE-ATOMICS-NEXT: and w8, w0, #0xff
; OUTLINE-ATOMICS-NEXT: adrp x9, var8
; OUTLINE-ATOMICS-NEXT: add x9, x9, :lo12:var8
; OUTLINE-ATOMICS-NEXT: .LBB[[LOOPSTART:.*]]: // %atomicrmw.start
; OUTLINE-ATOMICS-NEXT: // =>This Inner Loop Header: Depth=1
-; OUTLINE-ATOMICS-NEXT: ldaxrb w8, [x9]
-; OUTLINE-ATOMICS-NEXT: cmp w8, w0, uxtb
-; OUTLINE-ATOMICS-NEXT: csel w10, w8, w0, ls
+; OUTLINE-ATOMICS-NEXT: ldaxrb w0, [x9]
+; OUTLINE-ATOMICS-NEXT: cmp w0, w8
+; OUTLINE-ATOMICS-NEXT: csel w10, w0, w8, ls
; OUTLINE-ATOMICS-NEXT: stlxrb w11, w10, [x9]
; OUTLINE-ATOMICS-NEXT: cbnz w11, .LBB[[LOOPSTART]]
; OUTLINE-ATOMICS-NEXT: // %bb.2: // %atomicrmw.end
-; OUTLINE-ATOMICS-NEXT: mov w0, w8
+; OUTLINE-ATOMICS-NEXT: // kill: def $w0 killed $w0 killed $x0
; OUTLINE-ATOMICS-NEXT: ret
%old = atomicrmw umin i8* @var8, i8 %offset seq_cst
; CHECK-NOT: dmb
; CHECK-LABEL: test_atomic_load_umin_i16:
; OUTLINE-ATOMICS-LABEL: test_atomic_load_umin_i16:
; OUTLINE-ATOMICS: // %bb.0:
+; OUTLINE-ATOMICS-NEXT: and w8, w0, #0xffff
; OUTLINE-ATOMICS-NEXT: adrp x9, var16
; OUTLINE-ATOMICS-NEXT: add x9, x9, :lo12:var16
; OUTLINE-ATOMICS-NEXT: .LBB[[LOOPSTART:.*]]: // %atomicrmw.start
; OUTLINE-ATOMICS-NEXT: // =>This Inner Loop Header: Depth=1
-; OUTLINE-ATOMICS-NEXT: ldaxrh w8, [x9]
-; OUTLINE-ATOMICS-NEXT: cmp w8, w0, uxth
-; OUTLINE-ATOMICS-NEXT: csel w10, w8, w0, ls
+; OUTLINE-ATOMICS-NEXT: ldaxrh w0, [x9]
+; OUTLINE-ATOMICS-NEXT: cmp w0, w8
+; OUTLINE-ATOMICS-NEXT: csel w10, w0, w8, ls
; OUTLINE-ATOMICS-NEXT: stlxrh w11, w10, [x9]
; OUTLINE-ATOMICS-NEXT: cbnz w11, .LBB[[LOOPSTART]]
; OUTLINE-ATOMICS-NEXT: // %bb.2: // %atomicrmw.end
-; OUTLINE-ATOMICS-NEXT: mov w0, w8
+; OUTLINE-ATOMICS-NEXT: // kill: def $w0 killed $w0 killed $x0
; OUTLINE-ATOMICS-NEXT: ret
%old = atomicrmw umin i16* @var16, i16 %offset seq_cst
; CHECK-NOT: dmb
; CHECK-LABEL: test_atomic_load_umax_i8:
; OUTLINE-ATOMICS-LABEL: test_atomic_load_umax_i8:
; OUTLINE-ATOMICS: // %bb.0:
+; OUTLINE-ATOMICS-NEXT: and w8, w0, #0xff
; OUTLINE-ATOMICS-NEXT: adrp x9, var8
; OUTLINE-ATOMICS-NEXT: add x9, x9, :lo12:var8
; OUTLINE-ATOMICS-NEXT: .LBB[[LOOPSTART:.*]]: // %atomicrmw.start
; OUTLINE-ATOMICS-NEXT: // =>This Inner Loop Header: Depth=1
-; OUTLINE-ATOMICS-NEXT: ldaxrb w8, [x9]
-; OUTLINE-ATOMICS-NEXT: cmp w8, w0, uxtb
-; OUTLINE-ATOMICS-NEXT: csel w10, w8, w0, hi
+; OUTLINE-ATOMICS-NEXT: ldaxrb w0, [x9]
+; OUTLINE-ATOMICS-NEXT: cmp w0, w8
+; OUTLINE-ATOMICS-NEXT: csel w10, w0, w8, hi
; OUTLINE-ATOMICS-NEXT: stlxrb w11, w10, [x9]
; OUTLINE-ATOMICS-NEXT: cbnz w11, .LBB[[LOOPSTART]]
; OUTLINE-ATOMICS-NEXT: // %bb.2: // %atomicrmw.end
-; OUTLINE-ATOMICS-NEXT: mov w0, w8
+; OUTLINE-ATOMICS-NEXT: // kill: def $w0 killed $w0 killed $x0
; OUTLINE-ATOMICS-NEXT: ret
%old = atomicrmw umax i8* @var8, i8 %offset seq_cst
; CHECK-NOT: dmb
; CHECK-LABEL: test_atomic_load_umax_i16:
; OUTLINE-ATOMICS-LABEL: test_atomic_load_umax_i16:
; OUTLINE-ATOMICS: // %bb.0:
+; OUTLINE-ATOMICS-NEXT: and w8, w0, #0xffff
; OUTLINE-ATOMICS-NEXT: adrp x9, var16
; OUTLINE-ATOMICS-NEXT: add x9, x9, :lo12:var16
; OUTLINE-ATOMICS-NEXT: .LBB[[LOOPSTART:.*]]: // %atomicrmw.start
; OUTLINE-ATOMICS-NEXT: // =>This Inner Loop Header: Depth=1
-; OUTLINE-ATOMICS-NEXT: ldaxrh w8, [x9]
-; OUTLINE-ATOMICS-NEXT: cmp w8, w0, uxth
-; OUTLINE-ATOMICS-NEXT: csel w10, w8, w0, hi
+; OUTLINE-ATOMICS-NEXT: ldaxrh w0, [x9]
+; OUTLINE-ATOMICS-NEXT: cmp w0, w8
+; OUTLINE-ATOMICS-NEXT: csel w10, w0, w8, hi
; OUTLINE-ATOMICS-NEXT: stlxrh w11, w10, [x9]
; OUTLINE-ATOMICS-NEXT: cbnz w11, .LBB[[LOOPSTART]]
; OUTLINE-ATOMICS-NEXT: // %bb.2: // %atomicrmw.end
-; OUTLINE-ATOMICS-NEXT: mov w0, w8
+; OUTLINE-ATOMICS-NEXT: // kill: def $w0 killed $w0 killed $x0
; OUTLINE-ATOMICS-NEXT: ret
%old = atomicrmw umax i16* @var16, i16 %offset seq_cst
; CHECK-NOT: dmb
; CHECK-LABEL: test_atomic_load_umax_i8_acq_rel:
; OUTLINE-ATOMICS-LABEL: test_atomic_load_umax_i8_acq_rel:
; OUTLINE-ATOMICS: // %bb.0:
+; OUTLINE-ATOMICS-NEXT: and w8, w0, #0xff
; OUTLINE-ATOMICS-NEXT: adrp x9, var8
; OUTLINE-ATOMICS-NEXT: add x9, x9, :lo12:var8
; OUTLINE-ATOMICS-NEXT: .LBB[[LOOPSTART:.*]]: // %atomicrmw.start
; OUTLINE-ATOMICS-NEXT: // =>This Inner Loop Header: Depth=1
-; OUTLINE-ATOMICS-NEXT: ldaxrb w8, [x9]
-; OUTLINE-ATOMICS-NEXT: cmp w8, w0, uxtb
-; OUTLINE-ATOMICS-NEXT: csel w10, w8, w0, hi
+; OUTLINE-ATOMICS-NEXT: ldaxrb w0, [x9]
+; OUTLINE-ATOMICS-NEXT: cmp w0, w8
+; OUTLINE-ATOMICS-NEXT: csel w10, w0, w8, hi
; OUTLINE-ATOMICS-NEXT: stlxrb w11, w10, [x9]
; OUTLINE-ATOMICS-NEXT: cbnz w11, .LBB[[LOOPSTART]]
; OUTLINE-ATOMICS-NEXT: // %bb.2: // %atomicrmw.end
-; OUTLINE-ATOMICS-NEXT: mov w0, w8
+; OUTLINE-ATOMICS-NEXT: // kill: def $w0 killed $w0 killed $x0
; OUTLINE-ATOMICS-NEXT: ret
%old = atomicrmw umax i8* @var8, i8 %offset acq_rel
; CHECK-NOT: dmb
; CHECK-LABEL: test_atomic_load_umax_i16_acq_rel:
; OUTLINE-ATOMICS-LABEL: test_atomic_load_umax_i16_acq_rel:
; OUTLINE-ATOMICS: // %bb.0:
+; OUTLINE-ATOMICS-NEXT: and w8, w0, #0xffff
; OUTLINE-ATOMICS-NEXT: adrp x9, var16
; OUTLINE-ATOMICS-NEXT: add x9, x9, :lo12:var16
; OUTLINE-ATOMICS-NEXT: .LBB[[LOOPSTART:.*]]: // %atomicrmw.start
; OUTLINE-ATOMICS-NEXT: // =>This Inner Loop Header: Depth=1
-; OUTLINE-ATOMICS-NEXT: ldaxrh w8, [x9]
-; OUTLINE-ATOMICS-NEXT: cmp w8, w0, uxth
-; OUTLINE-ATOMICS-NEXT: csel w10, w8, w0, hi
+; OUTLINE-ATOMICS-NEXT: ldaxrh w0, [x9]
+; OUTLINE-ATOMICS-NEXT: cmp w0, w8
+; OUTLINE-ATOMICS-NEXT: csel w10, w0, w8, hi
; OUTLINE-ATOMICS-NEXT: stlxrh w11, w10, [x9]
; OUTLINE-ATOMICS-NEXT: cbnz w11, .LBB[[LOOPSTART]]
; OUTLINE-ATOMICS-NEXT: // %bb.2: // %atomicrmw.end
-; OUTLINE-ATOMICS-NEXT: mov w0, w8
+; OUTLINE-ATOMICS-NEXT: // kill: def $w0 killed $w0 killed $x0
; OUTLINE-ATOMICS-NEXT: ret
%old = atomicrmw umax i16* @var16, i16 %offset acq_rel
; CHECK-NOT: dmb
; CHECK-LABEL: test_atomic_load_umax_i8_acquire:
; OUTLINE-ATOMICS-LABEL: test_atomic_load_umax_i8_acquire:
; OUTLINE-ATOMICS: // %bb.0:
+; OUTLINE-ATOMICS-NEXT: and w8, w0, #0xff
; OUTLINE-ATOMICS-NEXT: adrp x9, var8
; OUTLINE-ATOMICS-NEXT: add x9, x9, :lo12:var8
; OUTLINE-ATOMICS-NEXT: .LBB[[LOOPSTART:.*]]: // %atomicrmw.start
; OUTLINE-ATOMICS-NEXT: // =>This Inner Loop Header: Depth=1
-; OUTLINE-ATOMICS-NEXT: ldaxrb w8, [x9]
-; OUTLINE-ATOMICS-NEXT: cmp w8, w0, uxtb
-; OUTLINE-ATOMICS-NEXT: csel w10, w8, w0, hi
+; OUTLINE-ATOMICS-NEXT: ldaxrb w0, [x9]
+; OUTLINE-ATOMICS-NEXT: cmp w0, w8
+; OUTLINE-ATOMICS-NEXT: csel w10, w0, w8, hi
; OUTLINE-ATOMICS-NEXT: stxrb w11, w10, [x9]
; OUTLINE-ATOMICS-NEXT: cbnz w11, .LBB[[LOOPSTART]]
; OUTLINE-ATOMICS-NEXT: // %bb.2: // %atomicrmw.end
-; OUTLINE-ATOMICS-NEXT: mov w0, w8
+; OUTLINE-ATOMICS-NEXT: // kill: def $w0 killed $w0 killed $x0
; OUTLINE-ATOMICS-NEXT: ret
%old = atomicrmw umax i8* @var8, i8 %offset acquire
; CHECK-NOT: dmb
; CHECK-LABEL: test_atomic_load_umax_i16_acquire:
; OUTLINE-ATOMICS-LABEL: test_atomic_load_umax_i16_acquire:
; OUTLINE-ATOMICS: // %bb.0:
+; OUTLINE-ATOMICS-NEXT: and w8, w0, #0xffff
; OUTLINE-ATOMICS-NEXT: adrp x9, var16
; OUTLINE-ATOMICS-NEXT: add x9, x9, :lo12:var16
; OUTLINE-ATOMICS-NEXT: .LBB[[LOOPSTART:.*]]: // %atomicrmw.start
; OUTLINE-ATOMICS-NEXT: // =>This Inner Loop Header: Depth=1
-; OUTLINE-ATOMICS-NEXT: ldaxrh w8, [x9]
-; OUTLINE-ATOMICS-NEXT: cmp w8, w0, uxth
-; OUTLINE-ATOMICS-NEXT: csel w10, w8, w0, hi
+; OUTLINE-ATOMICS-NEXT: ldaxrh w0, [x9]
+; OUTLINE-ATOMICS-NEXT: cmp w0, w8
+; OUTLINE-ATOMICS-NEXT: csel w10, w0, w8, hi
; OUTLINE-ATOMICS-NEXT: stxrh w11, w10, [x9]
; OUTLINE-ATOMICS-NEXT: cbnz w11, .LBB[[LOOPSTART]]
; OUTLINE-ATOMICS-NEXT: // %bb.2: // %atomicrmw.end
-; OUTLINE-ATOMICS-NEXT: mov w0, w8
+; OUTLINE-ATOMICS-NEXT: // kill: def $w0 killed $w0 killed $x0
; OUTLINE-ATOMICS-NEXT: ret
%old = atomicrmw umax i16* @var16, i16 %offset acquire
; CHECK-NOT: dmb
; CHECK-LABEL: test_atomic_load_umax_i8_monotonic:
; OUTLINE-ATOMICS-LABEL: test_atomic_load_umax_i8_monotonic:
; OUTLINE-ATOMICS: // %bb.0:
+; OUTLINE-ATOMICS-NEXT: and w8, w0, #0xff
; OUTLINE-ATOMICS-NEXT: adrp x9, var8
; OUTLINE-ATOMICS-NEXT: add x9, x9, :lo12:var8
; OUTLINE-ATOMICS-NEXT: .LBB[[LOOPSTART:.*]]: // %atomicrmw.start
; OUTLINE-ATOMICS-NEXT: // =>This Inner Loop Header: Depth=1
-; OUTLINE-ATOMICS-NEXT: ldxrb w8, [x9]
-; OUTLINE-ATOMICS-NEXT: cmp w8, w0, uxtb
-; OUTLINE-ATOMICS-NEXT: csel w10, w8, w0, hi
+; OUTLINE-ATOMICS-NEXT: ldxrb w0, [x9]
+; OUTLINE-ATOMICS-NEXT: cmp w0, w8
+; OUTLINE-ATOMICS-NEXT: csel w10, w0, w8, hi
; OUTLINE-ATOMICS-NEXT: stxrb w11, w10, [x9]
; OUTLINE-ATOMICS-NEXT: cbnz w11, .LBB[[LOOPSTART]]
; OUTLINE-ATOMICS-NEXT: // %bb.2: // %atomicrmw.end
-; OUTLINE-ATOMICS-NEXT: mov w0, w8
+; OUTLINE-ATOMICS-NEXT: // kill: def $w0 killed $w0 killed $x0
; OUTLINE-ATOMICS-NEXT: ret
%old = atomicrmw umax i8* @var8, i8 %offset monotonic
; CHECK-NOT: dmb
; CHECK-LABEL: test_atomic_load_umax_i16_monotonic:
; OUTLINE-ATOMICS-LABEL: test_atomic_load_umax_i16_monotonic:
; OUTLINE-ATOMICS: // %bb.0:
+; OUTLINE-ATOMICS-NEXT: and w8, w0, #0xffff
; OUTLINE-ATOMICS-NEXT: adrp x9, var16
; OUTLINE-ATOMICS-NEXT: add x9, x9, :lo12:var16
; OUTLINE-ATOMICS-NEXT: .LBB[[LOOPSTART:.*]]: // %atomicrmw.start
; OUTLINE-ATOMICS-NEXT: // =>This Inner Loop Header: Depth=1
-; OUTLINE-ATOMICS-NEXT: ldxrh w8, [x9]
-; OUTLINE-ATOMICS-NEXT: cmp w8, w0, uxth
-; OUTLINE-ATOMICS-NEXT: csel w10, w8, w0, hi
+; OUTLINE-ATOMICS-NEXT: ldxrh w0, [x9]
+; OUTLINE-ATOMICS-NEXT: cmp w0, w8
+; OUTLINE-ATOMICS-NEXT: csel w10, w0, w8, hi
; OUTLINE-ATOMICS-NEXT: stxrh w11, w10, [x9]
; OUTLINE-ATOMICS-NEXT: cbnz w11, .LBB[[LOOPSTART]]
; OUTLINE-ATOMICS-NEXT: // %bb.2: // %atomicrmw.end
-; OUTLINE-ATOMICS-NEXT: mov w0, w8
+; OUTLINE-ATOMICS-NEXT: // kill: def $w0 killed $w0 killed $x0
; OUTLINE-ATOMICS-NEXT: ret
%old = atomicrmw umax i16* @var16, i16 %offset monotonic
; CHECK-NOT: dmb
; CHECK-LABEL: test_atomic_load_umax_i8_release:
; OUTLINE-ATOMICS-LABEL: test_atomic_load_umax_i8_release:
; OUTLINE-ATOMICS: // %bb.0:
+; OUTLINE-ATOMICS-NEXT: and w8, w0, #0xff
; OUTLINE-ATOMICS-NEXT: adrp x9, var8
; OUTLINE-ATOMICS-NEXT: add x9, x9, :lo12:var8
; OUTLINE-ATOMICS-NEXT: .LBB[[LOOPSTART:.*]]: // %atomicrmw.start
; OUTLINE-ATOMICS-NEXT: // =>This Inner Loop Header: Depth=1
-; OUTLINE-ATOMICS-NEXT: ldxrb w8, [x9]
-; OUTLINE-ATOMICS-NEXT: cmp w8, w0, uxtb
-; OUTLINE-ATOMICS-NEXT: csel w10, w8, w0, hi
+; OUTLINE-ATOMICS-NEXT: ldxrb w0, [x9]
+; OUTLINE-ATOMICS-NEXT: cmp w0, w8
+; OUTLINE-ATOMICS-NEXT: csel w10, w0, w8, hi
; OUTLINE-ATOMICS-NEXT: stlxrb w11, w10, [x9]
; OUTLINE-ATOMICS-NEXT: cbnz w11, .LBB[[LOOPSTART]]
; OUTLINE-ATOMICS-NEXT: // %bb.2: // %atomicrmw.end
-; OUTLINE-ATOMICS-NEXT: mov w0, w8
+; OUTLINE-ATOMICS-NEXT: // kill: def $w0 killed $w0 killed $x0
; OUTLINE-ATOMICS-NEXT: ret
%old = atomicrmw umax i8* @var8, i8 %offset release
; CHECK-NOT: dmb
; CHECK-LABEL: test_atomic_load_umax_i16_release:
; OUTLINE-ATOMICS-LABEL: test_atomic_load_umax_i16_release:
; OUTLINE-ATOMICS: // %bb.0:
+; OUTLINE-ATOMICS-NEXT: and w8, w0, #0xffff
; OUTLINE-ATOMICS-NEXT: adrp x9, var16
; OUTLINE-ATOMICS-NEXT: add x9, x9, :lo12:var16
; OUTLINE-ATOMICS-NEXT: .LBB[[LOOPSTART:.*]]: // %atomicrmw.start
; OUTLINE-ATOMICS-NEXT: // =>This Inner Loop Header: Depth=1
-; OUTLINE-ATOMICS-NEXT: ldxrh w8, [x9]
-; OUTLINE-ATOMICS-NEXT: cmp w8, w0, uxth
-; OUTLINE-ATOMICS-NEXT: csel w10, w8, w0, hi
+; OUTLINE-ATOMICS-NEXT: ldxrh w0, [x9]
+; OUTLINE-ATOMICS-NEXT: cmp w0, w8
+; OUTLINE-ATOMICS-NEXT: csel w10, w0, w8, hi
; OUTLINE-ATOMICS-NEXT: stlxrh w11, w10, [x9]
; OUTLINE-ATOMICS-NEXT: cbnz w11, .LBB[[LOOPSTART]]
; OUTLINE-ATOMICS-NEXT: // %bb.2: // %atomicrmw.end
-; OUTLINE-ATOMICS-NEXT: mov w0, w8
+; OUTLINE-ATOMICS-NEXT: // kill: def $w0 killed $w0 killed $x0
; OUTLINE-ATOMICS-NEXT: ret
%old = atomicrmw umax i16* @var16, i16 %offset release
; CHECK-NOT: dmb
; CHECK-LABEL: test_atomic_load_umax_i8_seq_cst:
; OUTLINE-ATOMICS-LABEL: test_atomic_load_umax_i8_seq_cst:
; OUTLINE-ATOMICS: // %bb.0:
+; OUTLINE-ATOMICS-NEXT: and w8, w0, #0xff
; OUTLINE-ATOMICS-NEXT: adrp x9, var8
; OUTLINE-ATOMICS-NEXT: add x9, x9, :lo12:var8
; OUTLINE-ATOMICS-NEXT: .LBB[[LOOPSTART:.*]]: // %atomicrmw.start
; OUTLINE-ATOMICS-NEXT: // =>This Inner Loop Header: Depth=1
-; OUTLINE-ATOMICS-NEXT: ldaxrb w8, [x9]
-; OUTLINE-ATOMICS-NEXT: cmp w8, w0, uxtb
-; OUTLINE-ATOMICS-NEXT: csel w10, w8, w0, hi
+; OUTLINE-ATOMICS-NEXT: ldaxrb w0, [x9]
+; OUTLINE-ATOMICS-NEXT: cmp w0, w8
+; OUTLINE-ATOMICS-NEXT: csel w10, w0, w8, hi
; OUTLINE-ATOMICS-NEXT: stlxrb w11, w10, [x9]
; OUTLINE-ATOMICS-NEXT: cbnz w11, .LBB[[LOOPSTART]]
; OUTLINE-ATOMICS-NEXT: // %bb.2: // %atomicrmw.end
-; OUTLINE-ATOMICS-NEXT: mov w0, w8
+; OUTLINE-ATOMICS-NEXT: // kill: def $w0 killed $w0 killed $x0
; OUTLINE-ATOMICS-NEXT: ret
%old = atomicrmw umax i8* @var8, i8 %offset seq_cst
; CHECK-NOT: dmb
; CHECK-LABEL: test_atomic_load_umax_i16_seq_cst:
; OUTLINE-ATOMICS-LABEL: test_atomic_load_umax_i16_seq_cst:
; OUTLINE-ATOMICS: // %bb.0:
+; OUTLINE-ATOMICS-NEXT: and w8, w0, #0xffff
; OUTLINE-ATOMICS-NEXT: adrp x9, var16
; OUTLINE-ATOMICS-NEXT: add x9, x9, :lo12:var16
; OUTLINE-ATOMICS-NEXT: .LBB[[LOOPSTART:.*]]: // %atomicrmw.start
; OUTLINE-ATOMICS-NEXT: // =>This Inner Loop Header: Depth=1
-; OUTLINE-ATOMICS-NEXT: ldaxrh w8, [x9]
-; OUTLINE-ATOMICS-NEXT: cmp w8, w0, uxth
-; OUTLINE-ATOMICS-NEXT: csel w10, w8, w0, hi
+; OUTLINE-ATOMICS-NEXT: ldaxrh w0, [x9]
+; OUTLINE-ATOMICS-NEXT: cmp w0, w8
+; OUTLINE-ATOMICS-NEXT: csel w10, w0, w8, hi
; OUTLINE-ATOMICS-NEXT: stlxrh w11, w10, [x9]
; OUTLINE-ATOMICS-NEXT: cbnz w11, .LBB[[LOOPSTART]]
; OUTLINE-ATOMICS-NEXT: // %bb.2: // %atomicrmw.end
-; OUTLINE-ATOMICS-NEXT: mov w0, w8
+; OUTLINE-ATOMICS-NEXT: // kill: def $w0 killed $w0 killed $x0
; OUTLINE-ATOMICS-NEXT: ret
%old = atomicrmw umax i16* @var16, i16 %offset seq_cst
; CHECK-NOT: dmb
; CHECK-LABEL: test_atomic_load_umin_i8_acq_rel:
; OUTLINE-ATOMICS-LABEL: test_atomic_load_umin_i8_acq_rel:
; OUTLINE-ATOMICS: // %bb.0:
+; OUTLINE-ATOMICS-NEXT: and w8, w0, #0xff
; OUTLINE-ATOMICS-NEXT: adrp x9, var8
; OUTLINE-ATOMICS-NEXT: add x9, x9, :lo12:var8
; OUTLINE-ATOMICS-NEXT: .LBB[[LOOPSTART:.*]]: // %atomicrmw.start
; OUTLINE-ATOMICS-NEXT: // =>This Inner Loop Header: Depth=1
-; OUTLINE-ATOMICS-NEXT: ldaxrb w8, [x9]
-; OUTLINE-ATOMICS-NEXT: cmp w8, w0, uxtb
-; OUTLINE-ATOMICS-NEXT: csel w10, w8, w0, ls
+; OUTLINE-ATOMICS-NEXT: ldaxrb w0, [x9]
+; OUTLINE-ATOMICS-NEXT: cmp w0, w8
+; OUTLINE-ATOMICS-NEXT: csel w10, w0, w8, ls
; OUTLINE-ATOMICS-NEXT: stlxrb w11, w10, [x9]
; OUTLINE-ATOMICS-NEXT: cbnz w11, .LBB[[LOOPSTART]]
; OUTLINE-ATOMICS-NEXT: // %bb.2: // %atomicrmw.end
-; OUTLINE-ATOMICS-NEXT: mov w0, w8
+; OUTLINE-ATOMICS-NEXT: // kill: def $w0 killed $w0 killed $x0
; OUTLINE-ATOMICS-NEXT: ret
%old = atomicrmw umin i8* @var8, i8 %offset acq_rel
; CHECK-NOT: dmb
; CHECK-LABEL: test_atomic_load_umin_i16_acq_rel:
; OUTLINE-ATOMICS-LABEL: test_atomic_load_umin_i16_acq_rel:
; OUTLINE-ATOMICS: // %bb.0:
+; OUTLINE-ATOMICS-NEXT: and w8, w0, #0xffff
; OUTLINE-ATOMICS-NEXT: adrp x9, var16
; OUTLINE-ATOMICS-NEXT: add x9, x9, :lo12:var16
; OUTLINE-ATOMICS-NEXT: .LBB[[LOOPSTART:.*]]: // %atomicrmw.start
; OUTLINE-ATOMICS-NEXT: // =>This Inner Loop Header: Depth=1
-; OUTLINE-ATOMICS-NEXT: ldaxrh w8, [x9]
-; OUTLINE-ATOMICS-NEXT: cmp w8, w0, uxth
-; OUTLINE-ATOMICS-NEXT: csel w10, w8, w0, ls
+; OUTLINE-ATOMICS-NEXT: ldaxrh w0, [x9]
+; OUTLINE-ATOMICS-NEXT: cmp w0, w8
+; OUTLINE-ATOMICS-NEXT: csel w10, w0, w8, ls
; OUTLINE-ATOMICS-NEXT: stlxrh w11, w10, [x9]
; OUTLINE-ATOMICS-NEXT: cbnz w11, .LBB[[LOOPSTART]]
; OUTLINE-ATOMICS-NEXT: // %bb.2: // %atomicrmw.end
-; OUTLINE-ATOMICS-NEXT: mov w0, w8
+; OUTLINE-ATOMICS-NEXT: // kill: def $w0 killed $w0 killed $x0
; OUTLINE-ATOMICS-NEXT: ret
%old = atomicrmw umin i16* @var16, i16 %offset acq_rel
; CHECK-NOT: dmb
; CHECK-LABEL: test_atomic_load_umin_i8_acquire:
; OUTLINE-ATOMICS-LABEL: test_atomic_load_umin_i8_acquire:
; OUTLINE-ATOMICS: // %bb.0:
+; OUTLINE-ATOMICS-NEXT: and w8, w0, #0xff
; OUTLINE-ATOMICS-NEXT: adrp x9, var8
; OUTLINE-ATOMICS-NEXT: add x9, x9, :lo12:var8
; OUTLINE-ATOMICS-NEXT: .LBB[[LOOPSTART:.*]]: // %atomicrmw.start
; OUTLINE-ATOMICS-NEXT: // =>This Inner Loop Header: Depth=1
-; OUTLINE-ATOMICS-NEXT: ldaxrb w8, [x9]
-; OUTLINE-ATOMICS-NEXT: cmp w8, w0, uxtb
-; OUTLINE-ATOMICS-NEXT: csel w10, w8, w0, ls
+; OUTLINE-ATOMICS-NEXT: ldaxrb w0, [x9]
+; OUTLINE-ATOMICS-NEXT: cmp w0, w8
+; OUTLINE-ATOMICS-NEXT: csel w10, w0, w8, ls
; OUTLINE-ATOMICS-NEXT: stxrb w11, w10, [x9]
; OUTLINE-ATOMICS-NEXT: cbnz w11, .LBB[[LOOPSTART]]
; OUTLINE-ATOMICS-NEXT: // %bb.2: // %atomicrmw.end
-; OUTLINE-ATOMICS-NEXT: mov w0, w8
+; OUTLINE-ATOMICS-NEXT: // kill: def $w0 killed $w0 killed $x0
; OUTLINE-ATOMICS-NEXT: ret
%old = atomicrmw umin i8* @var8, i8 %offset acquire
; CHECK-NOT: dmb
; CHECK-LABEL: test_atomic_load_umin_i16_acquire:
; OUTLINE-ATOMICS-LABEL: test_atomic_load_umin_i16_acquire:
; OUTLINE-ATOMICS: // %bb.0:
+; OUTLINE-ATOMICS-NEXT: and w8, w0, #0xffff
; OUTLINE-ATOMICS-NEXT: adrp x9, var16
; OUTLINE-ATOMICS-NEXT: add x9, x9, :lo12:var16
; OUTLINE-ATOMICS-NEXT: .LBB[[LOOPSTART:.*]]: // %atomicrmw.start
; OUTLINE-ATOMICS-NEXT: // =>This Inner Loop Header: Depth=1
-; OUTLINE-ATOMICS-NEXT: ldaxrh w8, [x9]
-; OUTLINE-ATOMICS-NEXT: cmp w8, w0, uxth
-; OUTLINE-ATOMICS-NEXT: csel w10, w8, w0, ls
+; OUTLINE-ATOMICS-NEXT: ldaxrh w0, [x9]
+; OUTLINE-ATOMICS-NEXT: cmp w0, w8
+; OUTLINE-ATOMICS-NEXT: csel w10, w0, w8, ls
; OUTLINE-ATOMICS-NEXT: stxrh w11, w10, [x9]
; OUTLINE-ATOMICS-NEXT: cbnz w11, .LBB[[LOOPSTART]]
; OUTLINE-ATOMICS-NEXT: // %bb.2: // %atomicrmw.end
-; OUTLINE-ATOMICS-NEXT: mov w0, w8
+; OUTLINE-ATOMICS-NEXT: // kill: def $w0 killed $w0 killed $x0
; OUTLINE-ATOMICS-NEXT: ret
%old = atomicrmw umin i16* @var16, i16 %offset acquire
; CHECK-NOT: dmb
; CHECK-LABEL: test_atomic_load_umin_i8_monotonic:
; OUTLINE-ATOMICS-LABEL: test_atomic_load_umin_i8_monotonic:
; OUTLINE-ATOMICS: // %bb.0:
+; OUTLINE-ATOMICS-NEXT: and w8, w0, #0xff
; OUTLINE-ATOMICS-NEXT: adrp x9, var8
; OUTLINE-ATOMICS-NEXT: add x9, x9, :lo12:var8
; OUTLINE-ATOMICS-NEXT: .LBB[[LOOPSTART:.*]]: // %atomicrmw.start
; OUTLINE-ATOMICS-NEXT: // =>This Inner Loop Header: Depth=1
-; OUTLINE-ATOMICS-NEXT: ldxrb w8, [x9]
-; OUTLINE-ATOMICS-NEXT: cmp w8, w0, uxtb
-; OUTLINE-ATOMICS-NEXT: csel w10, w8, w0, ls
+; OUTLINE-ATOMICS-NEXT: ldxrb w0, [x9]
+; OUTLINE-ATOMICS-NEXT: cmp w0, w8
+; OUTLINE-ATOMICS-NEXT: csel w10, w0, w8, ls
; OUTLINE-ATOMICS-NEXT: stxrb w11, w10, [x9]
; OUTLINE-ATOMICS-NEXT: cbnz w11, .LBB[[LOOPSTART]]
; OUTLINE-ATOMICS-NEXT: // %bb.2: // %atomicrmw.end
-; OUTLINE-ATOMICS-NEXT: mov w0, w8
+; OUTLINE-ATOMICS-NEXT: // kill: def $w0 killed $w0 killed $x0
; OUTLINE-ATOMICS-NEXT: ret
%old = atomicrmw umin i8* @var8, i8 %offset monotonic
; CHECK-NOT: dmb
; CHECK-LABEL: test_atomic_load_umin_i16_monotonic:
; OUTLINE-ATOMICS-LABEL: test_atomic_load_umin_i16_monotonic:
; OUTLINE-ATOMICS: // %bb.0:
+; OUTLINE-ATOMICS-NEXT: and w8, w0, #0xffff
; OUTLINE-ATOMICS-NEXT: adrp x9, var16
; OUTLINE-ATOMICS-NEXT: add x9, x9, :lo12:var16
; OUTLINE-ATOMICS-NEXT: .LBB[[LOOPSTART:.*]]: // %atomicrmw.start
; OUTLINE-ATOMICS-NEXT: // =>This Inner Loop Header: Depth=1
-; OUTLINE-ATOMICS-NEXT: ldxrh w8, [x9]
-; OUTLINE-ATOMICS-NEXT: cmp w8, w0, uxth
-; OUTLINE-ATOMICS-NEXT: csel w10, w8, w0, ls
+; OUTLINE-ATOMICS-NEXT: ldxrh w0, [x9]
+; OUTLINE-ATOMICS-NEXT: cmp w0, w8
+; OUTLINE-ATOMICS-NEXT: csel w10, w0, w8, ls
; OUTLINE-ATOMICS-NEXT: stxrh w11, w10, [x9]
; OUTLINE-ATOMICS-NEXT: cbnz w11, .LBB[[LOOPSTART]]
; OUTLINE-ATOMICS-NEXT: // %bb.2: // %atomicrmw.end
-; OUTLINE-ATOMICS-NEXT: mov w0, w8
+; OUTLINE-ATOMICS-NEXT: // kill: def $w0 killed $w0 killed $x0
; OUTLINE-ATOMICS-NEXT: ret
%old = atomicrmw umin i16* @var16, i16 %offset monotonic
; CHECK-NOT: dmb
; CHECK-LABEL: test_atomic_load_umin_i8_release:
; OUTLINE-ATOMICS-LABEL: test_atomic_load_umin_i8_release:
; OUTLINE-ATOMICS: // %bb.0:
+; OUTLINE-ATOMICS-NEXT: and w8, w0, #0xff
; OUTLINE-ATOMICS-NEXT: adrp x9, var8
; OUTLINE-ATOMICS-NEXT: add x9, x9, :lo12:var8
; OUTLINE-ATOMICS-NEXT: .LBB[[LOOPSTART:.*]]: // %atomicrmw.start
; OUTLINE-ATOMICS-NEXT: // =>This Inner Loop Header: Depth=1
-; OUTLINE-ATOMICS-NEXT: ldxrb w8, [x9]
-; OUTLINE-ATOMICS-NEXT: cmp w8, w0, uxtb
-; OUTLINE-ATOMICS-NEXT: csel w10, w8, w0, ls
+; OUTLINE-ATOMICS-NEXT: ldxrb w0, [x9]
+; OUTLINE-ATOMICS-NEXT: cmp w0, w8
+; OUTLINE-ATOMICS-NEXT: csel w10, w0, w8, ls
; OUTLINE-ATOMICS-NEXT: stlxrb w11, w10, [x9]
; OUTLINE-ATOMICS-NEXT: cbnz w11, .LBB[[LOOPSTART]]
; OUTLINE-ATOMICS-NEXT: // %bb.2: // %atomicrmw.end
-; OUTLINE-ATOMICS-NEXT: mov w0, w8
+; OUTLINE-ATOMICS-NEXT: // kill: def $w0 killed $w0 killed $x0
; OUTLINE-ATOMICS-NEXT: ret
%old = atomicrmw umin i8* @var8, i8 %offset release
; CHECK-NOT: dmb
; CHECK-LABEL: test_atomic_load_umin_i16_release:
; OUTLINE-ATOMICS-LABEL: test_atomic_load_umin_i16_release:
; OUTLINE-ATOMICS: // %bb.0:
+; OUTLINE-ATOMICS-NEXT: and w8, w0, #0xffff
; OUTLINE-ATOMICS-NEXT: adrp x9, var16
; OUTLINE-ATOMICS-NEXT: add x9, x9, :lo12:var16
; OUTLINE-ATOMICS-NEXT: .LBB[[LOOPSTART:.*]]: // %atomicrmw.start
; OUTLINE-ATOMICS-NEXT: // =>This Inner Loop Header: Depth=1
-; OUTLINE-ATOMICS-NEXT: ldxrh w8, [x9]
-; OUTLINE-ATOMICS-NEXT: cmp w8, w0, uxth
-; OUTLINE-ATOMICS-NEXT: csel w10, w8, w0, ls
+; OUTLINE-ATOMICS-NEXT: ldxrh w0, [x9]
+; OUTLINE-ATOMICS-NEXT: cmp w0, w8
+; OUTLINE-ATOMICS-NEXT: csel w10, w0, w8, ls
; OUTLINE-ATOMICS-NEXT: stlxrh w11, w10, [x9]
; OUTLINE-ATOMICS-NEXT: cbnz w11, .LBB[[LOOPSTART]]
; OUTLINE-ATOMICS-NEXT: // %bb.2: // %atomicrmw.end
-; OUTLINE-ATOMICS-NEXT: mov w0, w8
+; OUTLINE-ATOMICS-NEXT: // kill: def $w0 killed $w0 killed $x0
; OUTLINE-ATOMICS-NEXT: ret
%old = atomicrmw umin i16* @var16, i16 %offset release
; CHECK-NOT: dmb
; CHECK-LABEL: test_atomic_load_umin_i8_seq_cst:
; OUTLINE-ATOMICS-LABEL: test_atomic_load_umin_i8_seq_cst:
; OUTLINE-ATOMICS: // %bb.0:
+; OUTLINE-ATOMICS-NEXT: and w8, w0, #0xff
; OUTLINE-ATOMICS-NEXT: adrp x9, var8
; OUTLINE-ATOMICS-NEXT: add x9, x9, :lo12:var8
; OUTLINE-ATOMICS-NEXT: .LBB[[LOOPSTART:.*]]: // %atomicrmw.start
; OUTLINE-ATOMICS-NEXT: // =>This Inner Loop Header: Depth=1
-; OUTLINE-ATOMICS-NEXT: ldaxrb w8, [x9]
-; OUTLINE-ATOMICS-NEXT: cmp w8, w0, uxtb
-; OUTLINE-ATOMICS-NEXT: csel w10, w8, w0, ls
+; OUTLINE-ATOMICS-NEXT: ldaxrb w0, [x9]
+; OUTLINE-ATOMICS-NEXT: cmp w0, w8
+; OUTLINE-ATOMICS-NEXT: csel w10, w0, w8, ls
; OUTLINE-ATOMICS-NEXT: stlxrb w11, w10, [x9]
; OUTLINE-ATOMICS-NEXT: cbnz w11, .LBB[[LOOPSTART]]
; OUTLINE-ATOMICS-NEXT: // %bb.2: // %atomicrmw.end
-; OUTLINE-ATOMICS-NEXT: mov w0, w8
+; OUTLINE-ATOMICS-NEXT: // kill: def $w0 killed $w0 killed $x0
; OUTLINE-ATOMICS-NEXT: ret
%old = atomicrmw umin i8* @var8, i8 %offset seq_cst
; CHECK-NOT: dmb
; CHECK-LABEL: test_atomic_load_umin_i16_seq_cst:
; OUTLINE-ATOMICS-LABEL: test_atomic_load_umin_i16_seq_cst:
; OUTLINE-ATOMICS: // %bb.0:
+; OUTLINE-ATOMICS-NEXT: and w8, w0, #0xffff
; OUTLINE-ATOMICS-NEXT: adrp x9, var16
; OUTLINE-ATOMICS-NEXT: add x9, x9, :lo12:var16
; OUTLINE-ATOMICS-NEXT: .LBB[[LOOPSTART:.*]]: // %atomicrmw.start
; OUTLINE-ATOMICS-NEXT: // =>This Inner Loop Header: Depth=1
-; OUTLINE-ATOMICS-NEXT: ldaxrh w8, [x9]
-; OUTLINE-ATOMICS-NEXT: cmp w8, w0, uxth
-; OUTLINE-ATOMICS-NEXT: csel w10, w8, w0, ls
+; OUTLINE-ATOMICS-NEXT: ldaxrh w0, [x9]
+; OUTLINE-ATOMICS-NEXT: cmp w0, w8
+; OUTLINE-ATOMICS-NEXT: csel w10, w0, w8, ls
; OUTLINE-ATOMICS-NEXT: stlxrh w11, w10, [x9]
; OUTLINE-ATOMICS-NEXT: cbnz w11, .LBB[[LOOPSTART]]
; OUTLINE-ATOMICS-NEXT: // %bb.2: // %atomicrmw.end
-; OUTLINE-ATOMICS-NEXT: mov w0, w8
+; OUTLINE-ATOMICS-NEXT: // kill: def $w0 killed $w0 killed $x0
; OUTLINE-ATOMICS-NEXT: ret
%old = atomicrmw umin i16* @var16, i16 %offset seq_cst
; CHECK-NOT: dmb
define dso_local i8 @test_atomic_load_umin_i8(i8 %offset) nounwind {
; CHECK-LABEL: test_atomic_load_umin_i8:
; CHECK: // %bb.0:
+; CHECK-NEXT: and w8, w0, #0xff
; CHECK-NEXT: adrp x9, var8
; CHECK-NEXT: add x9, x9, :lo12:var8
; CHECK-NEXT: .LBB32_1: // %atomicrmw.start
; CHECK-NEXT: // =>This Inner Loop Header: Depth=1
-; CHECK-NEXT: ldxrb w8, [x9]
-; CHECK-NEXT: cmp w8, w0, uxtb
-; CHECK-NEXT: csel w10, w8, w0, ls
+; CHECK-NEXT: ldxrb w0, [x9]
+; CHECK-NEXT: cmp w0, w8
+; CHECK-NEXT: csel w10, w0, w8, ls
; CHECK-NEXT: stxrb w11, w10, [x9]
; CHECK-NEXT: cbnz w11, .LBB32_1
; CHECK-NEXT: // %bb.2: // %atomicrmw.end
-; CHECK-NEXT: mov w0, w8
+; CHECK-NEXT: // kill: def $w0 killed $w0 killed $x0
; CHECK-NEXT: ret
%old = atomicrmw umin i8* @var8, i8 %offset monotonic
ret i8 %old
define dso_local i16 @test_atomic_load_umin_i16(i16 %offset) nounwind {
; CHECK-LABEL: test_atomic_load_umin_i16:
; CHECK: // %bb.0:
+; CHECK-NEXT: and w8, w0, #0xffff
; CHECK-NEXT: adrp x9, var16
; CHECK-NEXT: add x9, x9, :lo12:var16
; CHECK-NEXT: .LBB33_1: // %atomicrmw.start
; CHECK-NEXT: // =>This Inner Loop Header: Depth=1
-; CHECK-NEXT: ldaxrh w8, [x9]
-; CHECK-NEXT: cmp w8, w0, uxth
-; CHECK-NEXT: csel w10, w8, w0, ls
+; CHECK-NEXT: ldaxrh w0, [x9]
+; CHECK-NEXT: cmp w0, w8
+; CHECK-NEXT: csel w10, w0, w8, ls
; CHECK-NEXT: stxrh w11, w10, [x9]
; CHECK-NEXT: cbnz w11, .LBB33_1
; CHECK-NEXT: // %bb.2: // %atomicrmw.end
-; CHECK-NEXT: mov w0, w8
+; CHECK-NEXT: // kill: def $w0 killed $w0 killed $x0
; CHECK-NEXT: ret
%old = atomicrmw umin i16* @var16, i16 %offset acquire
ret i16 %old
define dso_local i8 @test_atomic_load_umax_i8(i8 %offset) nounwind {
; CHECK-LABEL: test_atomic_load_umax_i8:
; CHECK: // %bb.0:
+; CHECK-NEXT: and w8, w0, #0xff
; CHECK-NEXT: adrp x9, var8
; CHECK-NEXT: add x9, x9, :lo12:var8
; CHECK-NEXT: .LBB36_1: // %atomicrmw.start
; CHECK-NEXT: // =>This Inner Loop Header: Depth=1
-; CHECK-NEXT: ldaxrb w8, [x9]
-; CHECK-NEXT: cmp w8, w0, uxtb
-; CHECK-NEXT: csel w10, w8, w0, hi
+; CHECK-NEXT: ldaxrb w0, [x9]
+; CHECK-NEXT: cmp w0, w8
+; CHECK-NEXT: csel w10, w0, w8, hi
; CHECK-NEXT: stlxrb w11, w10, [x9]
; CHECK-NEXT: cbnz w11, .LBB36_1
; CHECK-NEXT: // %bb.2: // %atomicrmw.end
-; CHECK-NEXT: mov w0, w8
+; CHECK-NEXT: // kill: def $w0 killed $w0 killed $x0
; CHECK-NEXT: ret
%old = atomicrmw umax i8* @var8, i8 %offset acq_rel
ret i8 %old
define dso_local i16 @test_atomic_load_umax_i16(i16 %offset) nounwind {
; CHECK-LABEL: test_atomic_load_umax_i16:
; CHECK: // %bb.0:
+; CHECK-NEXT: and w8, w0, #0xffff
; CHECK-NEXT: adrp x9, var16
; CHECK-NEXT: add x9, x9, :lo12:var16
; CHECK-NEXT: .LBB37_1: // %atomicrmw.start
; CHECK-NEXT: // =>This Inner Loop Header: Depth=1
-; CHECK-NEXT: ldxrh w8, [x9]
-; CHECK-NEXT: cmp w8, w0, uxth
-; CHECK-NEXT: csel w10, w8, w0, hi
+; CHECK-NEXT: ldxrh w0, [x9]
+; CHECK-NEXT: cmp w0, w8
+; CHECK-NEXT: csel w10, w0, w8, hi
; CHECK-NEXT: stxrh w11, w10, [x9]
; CHECK-NEXT: cbnz w11, .LBB37_1
; CHECK-NEXT: // %bb.2: // %atomicrmw.end
-; CHECK-NEXT: mov w0, w8
+; CHECK-NEXT: // kill: def $w0 killed $w0 killed $x0
; CHECK-NEXT: ret
%old = atomicrmw umax i16* @var16, i16 %offset monotonic
ret i16 %old
; INLINE_ATOMICS-LABEL: test_atomic_cmpxchg_i8:
; INLINE_ATOMICS: // %bb.0:
; INLINE_ATOMICS-NEXT: // kill: def $w1 killed $w1 def $x1
+; INLINE_ATOMICS-NEXT: and w8, w0, #0xff
; INLINE_ATOMICS-NEXT: adrp x9, var8
; INLINE_ATOMICS-NEXT: add x9, x9, :lo12:var8
; INLINE_ATOMICS-NEXT: .LBB40_1: // %cmpxchg.start
; INLINE_ATOMICS-NEXT: // =>This Inner Loop Header: Depth=1
-; INLINE_ATOMICS-NEXT: ldaxrb w8, [x9]
-; INLINE_ATOMICS-NEXT: cmp w8, w0, uxtb
+; INLINE_ATOMICS-NEXT: ldaxrb w0, [x9]
+; INLINE_ATOMICS-NEXT: cmp w0, w8
; INLINE_ATOMICS-NEXT: b.ne .LBB40_4
; INLINE_ATOMICS-NEXT: // %bb.2: // %cmpxchg.trystore
; INLINE_ATOMICS-NEXT: // in Loop: Header=BB40_1 Depth=1
; INLINE_ATOMICS-NEXT: stxrb w10, w1, [x9]
; INLINE_ATOMICS-NEXT: cbnz w10, .LBB40_1
; INLINE_ATOMICS-NEXT: // %bb.3: // %cmpxchg.end
-; INLINE_ATOMICS-NEXT: mov w0, w8
+; INLINE_ATOMICS-NEXT: // kill: def $w0 killed $w0 killed $x0
; INLINE_ATOMICS-NEXT: ret
; INLINE_ATOMICS-NEXT: .LBB40_4: // %cmpxchg.nostore
; INLINE_ATOMICS-NEXT: clrex
-; INLINE_ATOMICS-NEXT: mov w0, w8
+; INLINE_ATOMICS-NEXT: // kill: def $w0 killed $w0 killed $x0
; INLINE_ATOMICS-NEXT: ret
;
; OUTLINE_ATOMICS-LABEL: test_atomic_cmpxchg_i8:
; INLINE_ATOMICS-LABEL: test_atomic_cmpxchg_i16:
; INLINE_ATOMICS: // %bb.0:
; INLINE_ATOMICS-NEXT: // kill: def $w1 killed $w1 def $x1
+; INLINE_ATOMICS-NEXT: and w8, w0, #0xffff
; INLINE_ATOMICS-NEXT: adrp x9, var16
; INLINE_ATOMICS-NEXT: add x9, x9, :lo12:var16
; INLINE_ATOMICS-NEXT: .LBB41_1: // %cmpxchg.start
; INLINE_ATOMICS-NEXT: // =>This Inner Loop Header: Depth=1
-; INLINE_ATOMICS-NEXT: ldaxrh w8, [x9]
-; INLINE_ATOMICS-NEXT: cmp w8, w0, uxth
+; INLINE_ATOMICS-NEXT: ldaxrh w0, [x9]
+; INLINE_ATOMICS-NEXT: cmp w0, w8
; INLINE_ATOMICS-NEXT: b.ne .LBB41_4
; INLINE_ATOMICS-NEXT: // %bb.2: // %cmpxchg.trystore
; INLINE_ATOMICS-NEXT: // in Loop: Header=BB41_1 Depth=1
; INLINE_ATOMICS-NEXT: stlxrh w10, w1, [x9]
; INLINE_ATOMICS-NEXT: cbnz w10, .LBB41_1
; INLINE_ATOMICS-NEXT: // %bb.3: // %cmpxchg.end
-; INLINE_ATOMICS-NEXT: mov w0, w8
+; INLINE_ATOMICS-NEXT: // kill: def $w0 killed $w0 killed $x0
; INLINE_ATOMICS-NEXT: ret
; INLINE_ATOMICS-NEXT: .LBB41_4: // %cmpxchg.nostore
; INLINE_ATOMICS-NEXT: clrex
-; INLINE_ATOMICS-NEXT: mov w0, w8
+; INLINE_ATOMICS-NEXT: // kill: def $w0 killed $w0 killed $x0
; INLINE_ATOMICS-NEXT: ret
;
; OUTLINE_ATOMICS-LABEL: test_atomic_cmpxchg_i16:
; CHECK-LABEL: phi_feeding_phi_args:
; CHECK: // %bb.0: // %entry
; CHECK-NEXT: and w8, w0, #0xff
-; CHECK-NEXT: cmp w8, w1, uxtb
-; CHECK-NEXT: csel w8, w0, w1, hi
+; CHECK-NEXT: and w9, w1, #0xff
+; CHECK-NEXT: cmp w8, w9
+; CHECK-NEXT: csel w8, w8, w9, hi
; CHECK-NEXT: .LBB0_1: // %loop
; CHECK-NEXT: // =>This Inner Loop Header: Depth=1
-; CHECK-NEXT: and w9, w8, #0xff
-; CHECK-NEXT: sub w10, w8, #2
-; CHECK-NEXT: lsl w8, w8, #1
-; CHECK-NEXT: cmp w9, #254
-; CHECK-NEXT: csel w8, w10, w8, lo
-; CHECK-NEXT: mvn w9, w8
-; CHECK-NEXT: tst w9, #0xff
+; CHECK-NEXT: sub w9, w8, #2
+; CHECK-NEXT: lsl w10, w8, #1
+; CHECK-NEXT: cmp w8, #254
+; CHECK-NEXT: csel w8, w9, w10, lo
+; CHECK-NEXT: cmp w8, #255
; CHECK-NEXT: b.ne .LBB0_1
; CHECK-NEXT: // %bb.2: // %exit
; CHECK-NEXT: ret
; CHECK-NEXT: csel w8, w0, w1, hi
; CHECK-NEXT: .LBB1_1: // %loop
; CHECK-NEXT: // =>This Inner Loop Header: Depth=1
-; CHECK-NEXT: and w9, w8, #0xff
-; CHECK-NEXT: sub w10, w8, #2
-; CHECK-NEXT: lsl w8, w8, #1
-; CHECK-NEXT: cmp w9, #254
-; CHECK-NEXT: csel w8, w10, w8, lo
-; CHECK-NEXT: mvn w9, w8
-; CHECK-NEXT: tst w9, #0xff
+; CHECK-NEXT: sub w9, w8, #2
+; CHECK-NEXT: lsl w10, w8, #1
+; CHECK-NEXT: cmp w8, #254
+; CHECK-NEXT: csel w8, w9, w10, lo
+; CHECK-NEXT: cmp w8, #255
; CHECK-NEXT: b.ne .LBB1_1
; CHECK-NEXT: // %bb.2: // %exit
; CHECK-NEXT: ret
; CHECK-NEXT: mov w9, #1
; CHECK-NEXT: .LBB2_1: // %loop
; CHECK-NEXT: // =>This Inner Loop Header: Depth=1
-; CHECK-NEXT: and w10, w8, #0xffff
-; CHECK-NEXT: cmp w10, #128
+; CHECK-NEXT: cmp w8, #128
; CHECK-NEXT: cinc w10, w9, lo
; CHECK-NEXT: add w8, w8, w10
-; CHECK-NEXT: and w10, w8, #0xffff
-; CHECK-NEXT: cmp w10, #253
+; CHECK-NEXT: cmp w8, #253
; CHECK-NEXT: b.lo .LBB2_1
; CHECK-NEXT: // %bb.2: // %exit
; CHECK-NEXT: ret
; CHECK-NEXT: mov w8, #1
; CHECK-NEXT: .LBB3_1: // %loop
; CHECK-NEXT: // =>This Inner Loop Header: Depth=1
-; CHECK-NEXT: sxtb w9, w0
-; CHECK-NEXT: cmp w9, #0
-; CHECK-NEXT: cinc w9, w8, ge
+; CHECK-NEXT: cmp w0, #128
+; CHECK-NEXT: cinc w9, w8, lo
; CHECK-NEXT: add w0, w0, w9
-; CHECK-NEXT: and w9, w0, #0xff
-; CHECK-NEXT: cmp w9, #252
+; CHECK-NEXT: cmp w0, #252
; CHECK-NEXT: b.hi .LBB3_1
; CHECK-NEXT: // %bb.2: // %exit
; CHECK-NEXT: ret
; CHECK-NEXT: // implicit-def: $w9
; CHECK-NEXT: .LBB4_1: // %loop
; CHECK-NEXT: // =>This Inner Loop Header: Depth=1
-; CHECK-NEXT: and w10, w9, #0xffff
-; CHECK-NEXT: cmp w10, #128
+; CHECK-NEXT: cmp w9, #128
; CHECK-NEXT: cinc w10, w8, lo
; CHECK-NEXT: add w9, w9, w10
-; CHECK-NEXT: and w10, w9, #0xffff
-; CHECK-NEXT: cmp w10, #253
+; CHECK-NEXT: cmp w9, #253
; CHECK-NEXT: b.lo .LBB4_1
; CHECK-NEXT: // %bb.2: // %exit
; CHECK-NEXT: ret
; CHECK: // %bb.0:
; CHECK-NEXT: add w8, w0, w0, lsl #1
; CHECK-NEXT: add w8, w8, #45
-; CHECK-NEXT: cmp w1, w8, uxth
-; CHECK-NEXT: cset w8, hi
+; CHECK-NEXT: cmp w8, w1
+; CHECK-NEXT: cset w8, lo
; CHECK-NEXT: strb w8, [x2]
; CHECK-NEXT: ret
%add = add nuw i16 %arg1, 15
define i16 @signext_bitcast_phi_select(i16 signext %start, i16* %in) {
; CHECK-LABEL: signext_bitcast_phi_select:
; CHECK: // %bb.0: // %entry
+; CHECK-NEXT: and w8, w0, #0xffff
; CHECK-NEXT: mov w9, #-1
-; CHECK-NEXT: // kill: def $w0 killed $w0 def $x0
-; CHECK-NEXT: cmp w9, w0, sxth
+; CHECK-NEXT: cmp w9, w8, sxth
; CHECK-NEXT: b.lt .LBB6_3
; CHECK-NEXT: .LBB6_1: // %if.then
; CHECK-NEXT: // =>This Inner Loop Header: Depth=1
-; CHECK-NEXT: sxth x8, w0
-; CHECK-NEXT: ldrh w8, [x1, x8, lsl #1]
-; CHECK-NEXT: cmp w8, w0, uxth
+; CHECK-NEXT: ldrh w0, [x1, w8, sxtw #1]
+; CHECK-NEXT: cmp w0, w8
; CHECK-NEXT: b.eq .LBB6_4
; CHECK-NEXT: // %bb.2: // %if.else
; CHECK-NEXT: // in Loop: Header=BB6_1 Depth=1
-; CHECK-NEXT: mvn w8, w0
-; CHECK-NEXT: and w8, w8, #0x8000
-; CHECK-NEXT: add w0, w0, w8, lsr #15
-; CHECK-NEXT: cmp w9, w0, sxth
+; CHECK-NEXT: lsr w10, w8, #15
+; CHECK-NEXT: eor w10, w10, #0x1
+; CHECK-NEXT: add w8, w10, w8
+; CHECK-NEXT: cmp w9, w8, sxth
; CHECK-NEXT: b.ge .LBB6_1
; CHECK-NEXT: .LBB6_3:
-; CHECK-NEXT: mov w8, wzr
+; CHECK-NEXT: mov w0, wzr
; CHECK-NEXT: .LBB6_4: // %exit
-; CHECK-NEXT: mov w0, w8
; CHECK-NEXT: ret
entry:
%const = bitcast i16 -1 to i16