Index: llvm/lib/CodeGen/CodeGenPrepare.cpp =================================================================== --- llvm/lib/CodeGen/CodeGenPrepare.cpp +++ llvm/lib/CodeGen/CodeGenPrepare.cpp @@ -268,6 +268,11 @@ MaxAddressUsersToScan("cgp-max-address-users-to-scan", cl::init(100), cl::Hidden, cl::desc("Max number of address users to look at")); + +static cl::opt + DisableDeletePHIs("disable-cgp-delete-phis", cl::Hidden, cl::init(false), + cl::desc("Disable elimination of dead PHI nodes.")); + namespace { enum ExtType { @@ -878,8 +883,12 @@ // as we remove them. // Note that this intentionally skips the entry block. SmallVector Blocks; - for (auto &Block : llvm::drop_begin(F)) + for (auto &Block : llvm::drop_begin(F)) { + // Delete Dead Phi nodes first. + if (!DisableDeletePHIs) + MadeChange |= DeleteDeadPHIs(&Block, TLInfo); Blocks.push_back(&Block); + } for (auto &Block : Blocks) { BasicBlock *BB = cast_or_null(Block); Index: llvm/test/CodeGen/AArch64/Atomics/aarch64-cmpxchg-lse2.ll =================================================================== --- llvm/test/CodeGen/AArch64/Atomics/aarch64-cmpxchg-lse2.ll +++ llvm/test/CodeGen/AArch64/Atomics/aarch64-cmpxchg-lse2.ll @@ -28,7 +28,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_monotonic_monotonic_weak: ; -O1: ldxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stxrb w9, w1, [x2] +; -O1: stxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new monotonic monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -59,7 +59,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_monotonic_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stxrb w9, w1, [x2] +; -O1: stxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new monotonic acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -90,7 +90,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_monotonic_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new monotonic seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -121,7 +121,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_acquire_monotonic_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stxrb w9, w1, [x2] +; -O1: stxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acquire monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -152,7 +152,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_acquire_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stxrb w9, w1, [x2] +; -O1: stxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acquire acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -183,7 +183,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_acquire_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acquire seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -214,7 +214,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_release_monotonic_weak: ; -O1: ldxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new release monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -245,7 +245,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_release_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new release acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -276,7 +276,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_release_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new release seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -307,7 +307,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_acq_rel_monotonic_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acq_rel monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -338,7 +338,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_acq_rel_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acq_rel acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -369,7 +369,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_acq_rel_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acq_rel seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -400,7 +400,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_seq_cst_monotonic_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new seq_cst monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -431,7 +431,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_seq_cst_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new seq_cst acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -462,7 +462,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_seq_cst_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new seq_cst seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -493,7 +493,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_monotonic_monotonic_weak: ; -O1: ldxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stxrh w9, w1, [x2] +; -O1: stxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new monotonic monotonic, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -524,7 +524,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_monotonic_acquire_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stxrh w9, w1, [x2] +; -O1: stxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new monotonic acquire, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -555,7 +555,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_monotonic_seq_cst_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new monotonic seq_cst, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -586,7 +586,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_acquire_monotonic_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stxrh w9, w1, [x2] +; -O1: stxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new acquire monotonic, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -617,7 +617,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_acquire_acquire_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stxrh w9, w1, [x2] +; -O1: stxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new acquire acquire, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -648,7 +648,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_acquire_seq_cst_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new acquire seq_cst, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -679,7 +679,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_release_monotonic_weak: ; -O1: ldxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new release monotonic, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -710,7 +710,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_release_acquire_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new release acquire, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -741,7 +741,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_release_seq_cst_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new release seq_cst, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -772,7 +772,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_acq_rel_monotonic_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new acq_rel monotonic, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -803,7 +803,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_acq_rel_acquire_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new acq_rel acquire, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -834,7 +834,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_acq_rel_seq_cst_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new acq_rel seq_cst, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -865,7 +865,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_seq_cst_monotonic_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new seq_cst monotonic, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -896,7 +896,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_seq_cst_acquire_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new seq_cst acquire, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -927,7 +927,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_seq_cst_seq_cst_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new seq_cst seq_cst, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -957,7 +957,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_monotonic_monotonic_weak: ; -O1: ldxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stxr w9, w1, [x2] +; -O1: stxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new monotonic monotonic, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -987,7 +987,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_monotonic_acquire_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stxr w9, w1, [x2] +; -O1: stxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new monotonic acquire, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1017,7 +1017,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_monotonic_seq_cst_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new monotonic seq_cst, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1047,7 +1047,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_acquire_monotonic_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stxr w9, w1, [x2] +; -O1: stxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new acquire monotonic, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1077,7 +1077,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_acquire_acquire_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stxr w9, w1, [x2] +; -O1: stxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new acquire acquire, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1107,7 +1107,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_acquire_seq_cst_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new acquire seq_cst, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1137,7 +1137,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_release_monotonic_weak: ; -O1: ldxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new release monotonic, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1167,7 +1167,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_release_acquire_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new release acquire, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1197,7 +1197,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_release_seq_cst_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new release seq_cst, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1227,7 +1227,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_acq_rel_monotonic_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new acq_rel monotonic, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1257,7 +1257,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_acq_rel_acquire_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new acq_rel acquire, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1287,7 +1287,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_acq_rel_seq_cst_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new acq_rel seq_cst, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1317,7 +1317,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_seq_cst_monotonic_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new seq_cst monotonic, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1347,7 +1347,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_seq_cst_acquire_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new seq_cst acquire, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1377,7 +1377,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_seq_cst_seq_cst_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new seq_cst seq_cst, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1407,7 +1407,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_monotonic_monotonic_weak: ; -O1: ldxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stxr w9, x1, [x2] +; -O1: stxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new monotonic monotonic, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1437,7 +1437,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_monotonic_acquire_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stxr w9, x1, [x2] +; -O1: stxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new monotonic acquire, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1467,7 +1467,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_monotonic_seq_cst_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new monotonic seq_cst, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1497,7 +1497,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_acquire_monotonic_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stxr w9, x1, [x2] +; -O1: stxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new acquire monotonic, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1527,7 +1527,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_acquire_acquire_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stxr w9, x1, [x2] +; -O1: stxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new acquire acquire, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1557,7 +1557,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_acquire_seq_cst_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new acquire seq_cst, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1587,7 +1587,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_release_monotonic_weak: ; -O1: ldxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new release monotonic, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1617,7 +1617,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_release_acquire_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new release acquire, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1647,7 +1647,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_release_seq_cst_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new release seq_cst, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1677,7 +1677,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_acq_rel_monotonic_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new acq_rel monotonic, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1707,7 +1707,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_acq_rel_acquire_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new acq_rel acquire, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1737,7 +1737,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_acq_rel_seq_cst_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new acq_rel seq_cst, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1767,7 +1767,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_seq_cst_monotonic_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new seq_cst monotonic, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1797,7 +1797,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_seq_cst_acquire_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new seq_cst acquire, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1827,7 +1827,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_seq_cst_seq_cst_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new seq_cst seq_cst, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -2428,7 +2428,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_monotonic_monotonic_weak: ; -O1: ldxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stxrb w9, w1, [x2] +; -O1: stxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new monotonic monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2459,7 +2459,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_monotonic_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stxrb w9, w1, [x2] +; -O1: stxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new monotonic acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2490,7 +2490,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_monotonic_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new monotonic seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2521,7 +2521,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_acquire_monotonic_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stxrb w9, w1, [x2] +; -O1: stxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acquire monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2552,7 +2552,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_acquire_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stxrb w9, w1, [x2] +; -O1: stxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acquire acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2583,7 +2583,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_acquire_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acquire seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2614,7 +2614,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_release_monotonic_weak: ; -O1: ldxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new release monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2645,7 +2645,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_release_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new release acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2676,7 +2676,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_release_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new release seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2707,7 +2707,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_acq_rel_monotonic_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acq_rel monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2738,7 +2738,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_acq_rel_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acq_rel acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2769,7 +2769,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_acq_rel_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acq_rel seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2800,7 +2800,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_seq_cst_monotonic_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new seq_cst monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2831,7 +2831,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_seq_cst_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new seq_cst acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2862,7 +2862,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_seq_cst_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new seq_cst seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r Index: llvm/test/CodeGen/AArch64/Atomics/aarch64-cmpxchg-rcpc.ll =================================================================== --- llvm/test/CodeGen/AArch64/Atomics/aarch64-cmpxchg-rcpc.ll +++ llvm/test/CodeGen/AArch64/Atomics/aarch64-cmpxchg-rcpc.ll @@ -28,7 +28,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_monotonic_monotonic_weak: ; -O1: ldxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stxrb w9, w1, [x2] +; -O1: stxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new monotonic monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -59,7 +59,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_monotonic_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stxrb w9, w1, [x2] +; -O1: stxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new monotonic acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -90,7 +90,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_monotonic_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new monotonic seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -121,7 +121,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_acquire_monotonic_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stxrb w9, w1, [x2] +; -O1: stxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acquire monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -152,7 +152,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_acquire_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stxrb w9, w1, [x2] +; -O1: stxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acquire acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -183,7 +183,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_acquire_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acquire seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -214,7 +214,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_release_monotonic_weak: ; -O1: ldxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new release monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -245,7 +245,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_release_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new release acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -276,7 +276,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_release_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new release seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -307,7 +307,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_acq_rel_monotonic_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acq_rel monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -338,7 +338,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_acq_rel_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acq_rel acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -369,7 +369,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_acq_rel_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acq_rel seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -400,7 +400,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_seq_cst_monotonic_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new seq_cst monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -431,7 +431,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_seq_cst_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new seq_cst acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -462,7 +462,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_seq_cst_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new seq_cst seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -493,7 +493,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_monotonic_monotonic_weak: ; -O1: ldxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stxrh w9, w1, [x2] +; -O1: stxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new monotonic monotonic, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -524,7 +524,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_monotonic_acquire_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stxrh w9, w1, [x2] +; -O1: stxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new monotonic acquire, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -555,7 +555,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_monotonic_seq_cst_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new monotonic seq_cst, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -586,7 +586,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_acquire_monotonic_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stxrh w9, w1, [x2] +; -O1: stxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new acquire monotonic, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -617,7 +617,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_acquire_acquire_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stxrh w9, w1, [x2] +; -O1: stxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new acquire acquire, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -648,7 +648,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_acquire_seq_cst_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new acquire seq_cst, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -679,7 +679,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_release_monotonic_weak: ; -O1: ldxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new release monotonic, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -710,7 +710,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_release_acquire_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new release acquire, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -741,7 +741,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_release_seq_cst_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new release seq_cst, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -772,7 +772,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_acq_rel_monotonic_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new acq_rel monotonic, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -803,7 +803,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_acq_rel_acquire_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new acq_rel acquire, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -834,7 +834,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_acq_rel_seq_cst_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new acq_rel seq_cst, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -865,7 +865,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_seq_cst_monotonic_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new seq_cst monotonic, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -896,7 +896,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_seq_cst_acquire_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new seq_cst acquire, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -927,7 +927,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_seq_cst_seq_cst_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new seq_cst seq_cst, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -957,7 +957,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_monotonic_monotonic_weak: ; -O1: ldxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stxr w9, w1, [x2] +; -O1: stxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new monotonic monotonic, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -987,7 +987,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_monotonic_acquire_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stxr w9, w1, [x2] +; -O1: stxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new monotonic acquire, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1017,7 +1017,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_monotonic_seq_cst_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new monotonic seq_cst, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1047,7 +1047,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_acquire_monotonic_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stxr w9, w1, [x2] +; -O1: stxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new acquire monotonic, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1077,7 +1077,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_acquire_acquire_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stxr w9, w1, [x2] +; -O1: stxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new acquire acquire, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1107,7 +1107,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_acquire_seq_cst_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new acquire seq_cst, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1137,7 +1137,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_release_monotonic_weak: ; -O1: ldxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new release monotonic, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1167,7 +1167,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_release_acquire_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new release acquire, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1197,7 +1197,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_release_seq_cst_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new release seq_cst, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1227,7 +1227,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_acq_rel_monotonic_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new acq_rel monotonic, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1257,7 +1257,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_acq_rel_acquire_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new acq_rel acquire, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1287,7 +1287,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_acq_rel_seq_cst_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new acq_rel seq_cst, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1317,7 +1317,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_seq_cst_monotonic_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new seq_cst monotonic, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1347,7 +1347,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_seq_cst_acquire_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new seq_cst acquire, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1377,7 +1377,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_seq_cst_seq_cst_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new seq_cst seq_cst, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1407,7 +1407,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_monotonic_monotonic_weak: ; -O1: ldxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stxr w9, x1, [x2] +; -O1: stxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new monotonic monotonic, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1437,7 +1437,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_monotonic_acquire_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stxr w9, x1, [x2] +; -O1: stxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new monotonic acquire, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1467,7 +1467,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_monotonic_seq_cst_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new monotonic seq_cst, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1497,7 +1497,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_acquire_monotonic_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stxr w9, x1, [x2] +; -O1: stxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new acquire monotonic, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1527,7 +1527,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_acquire_acquire_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stxr w9, x1, [x2] +; -O1: stxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new acquire acquire, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1557,7 +1557,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_acquire_seq_cst_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new acquire seq_cst, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1587,7 +1587,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_release_monotonic_weak: ; -O1: ldxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new release monotonic, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1617,7 +1617,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_release_acquire_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new release acquire, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1647,7 +1647,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_release_seq_cst_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new release seq_cst, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1677,7 +1677,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_acq_rel_monotonic_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new acq_rel monotonic, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1707,7 +1707,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_acq_rel_acquire_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new acq_rel acquire, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1737,7 +1737,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_acq_rel_seq_cst_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new acq_rel seq_cst, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1767,7 +1767,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_seq_cst_monotonic_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new seq_cst monotonic, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1797,7 +1797,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_seq_cst_acquire_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new seq_cst acquire, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1827,7 +1827,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_seq_cst_seq_cst_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new seq_cst seq_cst, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -2428,7 +2428,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_monotonic_monotonic_weak: ; -O1: ldxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stxrb w9, w1, [x2] +; -O1: stxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new monotonic monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2459,7 +2459,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_monotonic_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stxrb w9, w1, [x2] +; -O1: stxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new monotonic acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2490,7 +2490,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_monotonic_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new monotonic seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2521,7 +2521,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_acquire_monotonic_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stxrb w9, w1, [x2] +; -O1: stxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acquire monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2552,7 +2552,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_acquire_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stxrb w9, w1, [x2] +; -O1: stxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acquire acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2583,7 +2583,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_acquire_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acquire seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2614,7 +2614,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_release_monotonic_weak: ; -O1: ldxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new release monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2645,7 +2645,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_release_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new release acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2676,7 +2676,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_release_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new release seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2707,7 +2707,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_acq_rel_monotonic_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acq_rel monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2738,7 +2738,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_acq_rel_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acq_rel acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2769,7 +2769,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_acq_rel_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acq_rel seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2800,7 +2800,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_seq_cst_monotonic_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new seq_cst monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2831,7 +2831,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_seq_cst_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new seq_cst acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2862,7 +2862,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_seq_cst_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new seq_cst seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r Index: llvm/test/CodeGen/AArch64/Atomics/aarch64-cmpxchg-rcpc3.ll =================================================================== --- llvm/test/CodeGen/AArch64/Atomics/aarch64-cmpxchg-rcpc3.ll +++ llvm/test/CodeGen/AArch64/Atomics/aarch64-cmpxchg-rcpc3.ll @@ -28,7 +28,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_monotonic_monotonic_weak: ; -O1: ldxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stxrb w9, w1, [x2] +; -O1: stxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new monotonic monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -59,7 +59,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_monotonic_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stxrb w9, w1, [x2] +; -O1: stxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new monotonic acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -90,7 +90,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_monotonic_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new monotonic seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -121,7 +121,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_acquire_monotonic_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stxrb w9, w1, [x2] +; -O1: stxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acquire monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -152,7 +152,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_acquire_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stxrb w9, w1, [x2] +; -O1: stxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acquire acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -183,7 +183,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_acquire_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acquire seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -214,7 +214,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_release_monotonic_weak: ; -O1: ldxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new release monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -245,7 +245,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_release_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new release acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -276,7 +276,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_release_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new release seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -307,7 +307,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_acq_rel_monotonic_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acq_rel monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -338,7 +338,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_acq_rel_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acq_rel acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -369,7 +369,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_acq_rel_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acq_rel seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -400,7 +400,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_seq_cst_monotonic_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new seq_cst monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -431,7 +431,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_seq_cst_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new seq_cst acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -462,7 +462,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_seq_cst_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new seq_cst seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -493,7 +493,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_monotonic_monotonic_weak: ; -O1: ldxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stxrh w9, w1, [x2] +; -O1: stxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new monotonic monotonic, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -524,7 +524,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_monotonic_acquire_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stxrh w9, w1, [x2] +; -O1: stxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new monotonic acquire, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -555,7 +555,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_monotonic_seq_cst_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new monotonic seq_cst, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -586,7 +586,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_acquire_monotonic_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stxrh w9, w1, [x2] +; -O1: stxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new acquire monotonic, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -617,7 +617,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_acquire_acquire_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stxrh w9, w1, [x2] +; -O1: stxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new acquire acquire, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -648,7 +648,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_acquire_seq_cst_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new acquire seq_cst, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -679,7 +679,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_release_monotonic_weak: ; -O1: ldxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new release monotonic, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -710,7 +710,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_release_acquire_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new release acquire, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -741,7 +741,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_release_seq_cst_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new release seq_cst, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -772,7 +772,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_acq_rel_monotonic_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new acq_rel monotonic, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -803,7 +803,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_acq_rel_acquire_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new acq_rel acquire, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -834,7 +834,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_acq_rel_seq_cst_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new acq_rel seq_cst, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -865,7 +865,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_seq_cst_monotonic_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new seq_cst monotonic, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -896,7 +896,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_seq_cst_acquire_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new seq_cst acquire, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -927,7 +927,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_seq_cst_seq_cst_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new seq_cst seq_cst, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -957,7 +957,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_monotonic_monotonic_weak: ; -O1: ldxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stxr w9, w1, [x2] +; -O1: stxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new monotonic monotonic, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -987,7 +987,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_monotonic_acquire_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stxr w9, w1, [x2] +; -O1: stxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new monotonic acquire, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1017,7 +1017,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_monotonic_seq_cst_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new monotonic seq_cst, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1047,7 +1047,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_acquire_monotonic_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stxr w9, w1, [x2] +; -O1: stxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new acquire monotonic, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1077,7 +1077,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_acquire_acquire_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stxr w9, w1, [x2] +; -O1: stxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new acquire acquire, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1107,7 +1107,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_acquire_seq_cst_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new acquire seq_cst, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1137,7 +1137,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_release_monotonic_weak: ; -O1: ldxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new release monotonic, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1167,7 +1167,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_release_acquire_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new release acquire, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1197,7 +1197,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_release_seq_cst_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new release seq_cst, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1227,7 +1227,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_acq_rel_monotonic_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new acq_rel monotonic, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1257,7 +1257,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_acq_rel_acquire_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new acq_rel acquire, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1287,7 +1287,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_acq_rel_seq_cst_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new acq_rel seq_cst, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1317,7 +1317,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_seq_cst_monotonic_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new seq_cst monotonic, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1347,7 +1347,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_seq_cst_acquire_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new seq_cst acquire, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1377,7 +1377,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_seq_cst_seq_cst_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new seq_cst seq_cst, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1407,7 +1407,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_monotonic_monotonic_weak: ; -O1: ldxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stxr w9, x1, [x2] +; -O1: stxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new monotonic monotonic, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1437,7 +1437,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_monotonic_acquire_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stxr w9, x1, [x2] +; -O1: stxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new monotonic acquire, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1467,7 +1467,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_monotonic_seq_cst_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new monotonic seq_cst, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1497,7 +1497,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_acquire_monotonic_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stxr w9, x1, [x2] +; -O1: stxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new acquire monotonic, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1527,7 +1527,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_acquire_acquire_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stxr w9, x1, [x2] +; -O1: stxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new acquire acquire, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1557,7 +1557,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_acquire_seq_cst_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new acquire seq_cst, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1587,7 +1587,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_release_monotonic_weak: ; -O1: ldxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new release monotonic, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1617,7 +1617,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_release_acquire_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new release acquire, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1647,7 +1647,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_release_seq_cst_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new release seq_cst, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1677,7 +1677,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_acq_rel_monotonic_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new acq_rel monotonic, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1707,7 +1707,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_acq_rel_acquire_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new acq_rel acquire, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1737,7 +1737,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_acq_rel_seq_cst_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new acq_rel seq_cst, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1767,7 +1767,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_seq_cst_monotonic_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new seq_cst monotonic, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1797,7 +1797,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_seq_cst_acquire_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new seq_cst acquire, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1827,7 +1827,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_seq_cst_seq_cst_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new seq_cst seq_cst, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -2428,7 +2428,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_monotonic_monotonic_weak: ; -O1: ldxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stxrb w9, w1, [x2] +; -O1: stxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new monotonic monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2459,7 +2459,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_monotonic_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stxrb w9, w1, [x2] +; -O1: stxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new monotonic acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2490,7 +2490,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_monotonic_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new monotonic seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2521,7 +2521,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_acquire_monotonic_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stxrb w9, w1, [x2] +; -O1: stxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acquire monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2552,7 +2552,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_acquire_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stxrb w9, w1, [x2] +; -O1: stxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acquire acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2583,7 +2583,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_acquire_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acquire seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2614,7 +2614,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_release_monotonic_weak: ; -O1: ldxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new release monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2645,7 +2645,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_release_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new release acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2676,7 +2676,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_release_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new release seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2707,7 +2707,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_acq_rel_monotonic_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acq_rel monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2738,7 +2738,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_acq_rel_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acq_rel acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2769,7 +2769,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_acq_rel_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acq_rel seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2800,7 +2800,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_seq_cst_monotonic_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new seq_cst monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2831,7 +2831,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_seq_cst_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new seq_cst acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2862,7 +2862,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_seq_cst_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new seq_cst seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r Index: llvm/test/CodeGen/AArch64/Atomics/aarch64-cmpxchg-v8a.ll =================================================================== --- llvm/test/CodeGen/AArch64/Atomics/aarch64-cmpxchg-v8a.ll +++ llvm/test/CodeGen/AArch64/Atomics/aarch64-cmpxchg-v8a.ll @@ -28,7 +28,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_monotonic_monotonic_weak: ; -O1: ldxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stxrb w9, w1, [x2] +; -O1: stxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new monotonic monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -59,7 +59,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_monotonic_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stxrb w9, w1, [x2] +; -O1: stxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new monotonic acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -90,7 +90,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_monotonic_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new monotonic seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -121,7 +121,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_acquire_monotonic_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stxrb w9, w1, [x2] +; -O1: stxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acquire monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -152,7 +152,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_acquire_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stxrb w9, w1, [x2] +; -O1: stxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acquire acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -183,7 +183,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_acquire_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acquire seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -214,7 +214,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_release_monotonic_weak: ; -O1: ldxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new release monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -245,7 +245,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_release_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new release acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -276,7 +276,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_release_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new release seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -307,7 +307,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_acq_rel_monotonic_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acq_rel monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -338,7 +338,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_acq_rel_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acq_rel acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -369,7 +369,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_acq_rel_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acq_rel seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -400,7 +400,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_seq_cst_monotonic_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new seq_cst monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -431,7 +431,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_seq_cst_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new seq_cst acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -462,7 +462,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_seq_cst_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new seq_cst seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -493,7 +493,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_monotonic_monotonic_weak: ; -O1: ldxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stxrh w9, w1, [x2] +; -O1: stxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new monotonic monotonic, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -524,7 +524,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_monotonic_acquire_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stxrh w9, w1, [x2] +; -O1: stxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new monotonic acquire, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -555,7 +555,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_monotonic_seq_cst_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new monotonic seq_cst, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -586,7 +586,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_acquire_monotonic_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stxrh w9, w1, [x2] +; -O1: stxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new acquire monotonic, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -617,7 +617,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_acquire_acquire_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stxrh w9, w1, [x2] +; -O1: stxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new acquire acquire, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -648,7 +648,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_acquire_seq_cst_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new acquire seq_cst, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -679,7 +679,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_release_monotonic_weak: ; -O1: ldxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new release monotonic, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -710,7 +710,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_release_acquire_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new release acquire, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -741,7 +741,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_release_seq_cst_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new release seq_cst, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -772,7 +772,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_acq_rel_monotonic_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new acq_rel monotonic, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -803,7 +803,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_acq_rel_acquire_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new acq_rel acquire, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -834,7 +834,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_acq_rel_seq_cst_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new acq_rel seq_cst, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -865,7 +865,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_seq_cst_monotonic_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new seq_cst monotonic, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -896,7 +896,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_seq_cst_acquire_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new seq_cst acquire, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -927,7 +927,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_seq_cst_seq_cst_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new seq_cst seq_cst, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -957,7 +957,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_monotonic_monotonic_weak: ; -O1: ldxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stxr w9, w1, [x2] +; -O1: stxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new monotonic monotonic, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -987,7 +987,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_monotonic_acquire_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stxr w9, w1, [x2] +; -O1: stxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new monotonic acquire, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1017,7 +1017,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_monotonic_seq_cst_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new monotonic seq_cst, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1047,7 +1047,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_acquire_monotonic_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stxr w9, w1, [x2] +; -O1: stxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new acquire monotonic, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1077,7 +1077,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_acquire_acquire_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stxr w9, w1, [x2] +; -O1: stxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new acquire acquire, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1107,7 +1107,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_acquire_seq_cst_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new acquire seq_cst, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1137,7 +1137,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_release_monotonic_weak: ; -O1: ldxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new release monotonic, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1167,7 +1167,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_release_acquire_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new release acquire, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1197,7 +1197,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_release_seq_cst_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new release seq_cst, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1227,7 +1227,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_acq_rel_monotonic_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new acq_rel monotonic, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1257,7 +1257,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_acq_rel_acquire_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new acq_rel acquire, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1287,7 +1287,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_acq_rel_seq_cst_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new acq_rel seq_cst, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1317,7 +1317,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_seq_cst_monotonic_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new seq_cst monotonic, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1347,7 +1347,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_seq_cst_acquire_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new seq_cst acquire, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1377,7 +1377,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_seq_cst_seq_cst_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new seq_cst seq_cst, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1407,7 +1407,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_monotonic_monotonic_weak: ; -O1: ldxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stxr w9, x1, [x2] +; -O1: stxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new monotonic monotonic, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1437,7 +1437,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_monotonic_acquire_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stxr w9, x1, [x2] +; -O1: stxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new monotonic acquire, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1467,7 +1467,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_monotonic_seq_cst_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new monotonic seq_cst, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1497,7 +1497,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_acquire_monotonic_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stxr w9, x1, [x2] +; -O1: stxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new acquire monotonic, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1527,7 +1527,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_acquire_acquire_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stxr w9, x1, [x2] +; -O1: stxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new acquire acquire, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1557,7 +1557,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_acquire_seq_cst_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new acquire seq_cst, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1587,7 +1587,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_release_monotonic_weak: ; -O1: ldxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new release monotonic, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1617,7 +1617,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_release_acquire_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new release acquire, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1647,7 +1647,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_release_seq_cst_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new release seq_cst, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1677,7 +1677,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_acq_rel_monotonic_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new acq_rel monotonic, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1707,7 +1707,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_acq_rel_acquire_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new acq_rel acquire, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1737,7 +1737,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_acq_rel_seq_cst_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new acq_rel seq_cst, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1767,7 +1767,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_seq_cst_monotonic_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new seq_cst monotonic, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1797,7 +1797,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_seq_cst_acquire_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new seq_cst acquire, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1827,7 +1827,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_seq_cst_seq_cst_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new seq_cst seq_cst, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -2428,7 +2428,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_monotonic_monotonic_weak: ; -O1: ldxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stxrb w9, w1, [x2] +; -O1: stxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new monotonic monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2459,7 +2459,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_monotonic_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stxrb w9, w1, [x2] +; -O1: stxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new monotonic acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2490,7 +2490,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_monotonic_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new monotonic seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2521,7 +2521,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_acquire_monotonic_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stxrb w9, w1, [x2] +; -O1: stxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acquire monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2552,7 +2552,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_acquire_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stxrb w9, w1, [x2] +; -O1: stxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acquire acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2583,7 +2583,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_acquire_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acquire seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2614,7 +2614,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_release_monotonic_weak: ; -O1: ldxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new release monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2645,7 +2645,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_release_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new release acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2676,7 +2676,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_release_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new release seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2707,7 +2707,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_acq_rel_monotonic_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acq_rel monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2738,7 +2738,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_acq_rel_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acq_rel acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2769,7 +2769,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_acq_rel_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acq_rel seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2800,7 +2800,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_seq_cst_monotonic_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new seq_cst monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2831,7 +2831,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_seq_cst_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new seq_cst acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2862,7 +2862,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_seq_cst_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new seq_cst seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r Index: llvm/test/CodeGen/AArch64/Atomics/aarch64_be-cmpxchg-lse2.ll =================================================================== --- llvm/test/CodeGen/AArch64/Atomics/aarch64_be-cmpxchg-lse2.ll +++ llvm/test/CodeGen/AArch64/Atomics/aarch64_be-cmpxchg-lse2.ll @@ -28,7 +28,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_monotonic_monotonic_weak: ; -O1: ldxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stxrb w9, w1, [x2] +; -O1: stxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new monotonic monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -59,7 +59,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_monotonic_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stxrb w9, w1, [x2] +; -O1: stxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new monotonic acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -90,7 +90,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_monotonic_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new monotonic seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -121,7 +121,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_acquire_monotonic_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stxrb w9, w1, [x2] +; -O1: stxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acquire monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -152,7 +152,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_acquire_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stxrb w9, w1, [x2] +; -O1: stxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acquire acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -183,7 +183,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_acquire_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acquire seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -214,7 +214,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_release_monotonic_weak: ; -O1: ldxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new release monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -245,7 +245,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_release_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new release acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -276,7 +276,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_release_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new release seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -307,7 +307,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_acq_rel_monotonic_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acq_rel monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -338,7 +338,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_acq_rel_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acq_rel acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -369,7 +369,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_acq_rel_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acq_rel seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -400,7 +400,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_seq_cst_monotonic_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new seq_cst monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -431,7 +431,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_seq_cst_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new seq_cst acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -462,7 +462,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_seq_cst_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new seq_cst seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -493,7 +493,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_monotonic_monotonic_weak: ; -O1: ldxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stxrh w9, w1, [x2] +; -O1: stxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new monotonic monotonic, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -524,7 +524,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_monotonic_acquire_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stxrh w9, w1, [x2] +; -O1: stxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new monotonic acquire, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -555,7 +555,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_monotonic_seq_cst_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new monotonic seq_cst, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -586,7 +586,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_acquire_monotonic_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stxrh w9, w1, [x2] +; -O1: stxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new acquire monotonic, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -617,7 +617,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_acquire_acquire_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stxrh w9, w1, [x2] +; -O1: stxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new acquire acquire, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -648,7 +648,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_acquire_seq_cst_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new acquire seq_cst, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -679,7 +679,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_release_monotonic_weak: ; -O1: ldxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new release monotonic, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -710,7 +710,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_release_acquire_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new release acquire, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -741,7 +741,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_release_seq_cst_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new release seq_cst, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -772,7 +772,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_acq_rel_monotonic_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new acq_rel monotonic, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -803,7 +803,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_acq_rel_acquire_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new acq_rel acquire, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -834,7 +834,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_acq_rel_seq_cst_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new acq_rel seq_cst, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -865,7 +865,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_seq_cst_monotonic_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new seq_cst monotonic, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -896,7 +896,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_seq_cst_acquire_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new seq_cst acquire, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -927,7 +927,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_seq_cst_seq_cst_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new seq_cst seq_cst, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -957,7 +957,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_monotonic_monotonic_weak: ; -O1: ldxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stxr w9, w1, [x2] +; -O1: stxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new monotonic monotonic, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -987,7 +987,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_monotonic_acquire_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stxr w9, w1, [x2] +; -O1: stxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new monotonic acquire, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1017,7 +1017,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_monotonic_seq_cst_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new monotonic seq_cst, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1047,7 +1047,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_acquire_monotonic_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stxr w9, w1, [x2] +; -O1: stxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new acquire monotonic, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1077,7 +1077,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_acquire_acquire_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stxr w9, w1, [x2] +; -O1: stxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new acquire acquire, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1107,7 +1107,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_acquire_seq_cst_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new acquire seq_cst, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1137,7 +1137,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_release_monotonic_weak: ; -O1: ldxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new release monotonic, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1167,7 +1167,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_release_acquire_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new release acquire, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1197,7 +1197,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_release_seq_cst_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new release seq_cst, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1227,7 +1227,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_acq_rel_monotonic_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new acq_rel monotonic, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1257,7 +1257,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_acq_rel_acquire_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new acq_rel acquire, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1287,7 +1287,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_acq_rel_seq_cst_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new acq_rel seq_cst, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1317,7 +1317,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_seq_cst_monotonic_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new seq_cst monotonic, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1347,7 +1347,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_seq_cst_acquire_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new seq_cst acquire, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1377,7 +1377,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_seq_cst_seq_cst_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new seq_cst seq_cst, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1407,7 +1407,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_monotonic_monotonic_weak: ; -O1: ldxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stxr w9, x1, [x2] +; -O1: stxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new monotonic monotonic, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1437,7 +1437,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_monotonic_acquire_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stxr w9, x1, [x2] +; -O1: stxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new monotonic acquire, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1467,7 +1467,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_monotonic_seq_cst_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new monotonic seq_cst, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1497,7 +1497,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_acquire_monotonic_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stxr w9, x1, [x2] +; -O1: stxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new acquire monotonic, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1527,7 +1527,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_acquire_acquire_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stxr w9, x1, [x2] +; -O1: stxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new acquire acquire, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1557,7 +1557,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_acquire_seq_cst_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new acquire seq_cst, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1587,7 +1587,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_release_monotonic_weak: ; -O1: ldxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new release monotonic, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1617,7 +1617,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_release_acquire_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new release acquire, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1647,7 +1647,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_release_seq_cst_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new release seq_cst, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1677,7 +1677,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_acq_rel_monotonic_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new acq_rel monotonic, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1707,7 +1707,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_acq_rel_acquire_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new acq_rel acquire, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1737,7 +1737,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_acq_rel_seq_cst_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new acq_rel seq_cst, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1767,7 +1767,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_seq_cst_monotonic_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new seq_cst monotonic, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1797,7 +1797,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_seq_cst_acquire_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new seq_cst acquire, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1827,7 +1827,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_seq_cst_seq_cst_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new seq_cst seq_cst, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -2428,7 +2428,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_monotonic_monotonic_weak: ; -O1: ldxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stxrb w9, w1, [x2] +; -O1: stxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new monotonic monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2459,7 +2459,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_monotonic_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stxrb w9, w1, [x2] +; -O1: stxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new monotonic acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2490,7 +2490,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_monotonic_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new monotonic seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2521,7 +2521,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_acquire_monotonic_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stxrb w9, w1, [x2] +; -O1: stxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acquire monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2552,7 +2552,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_acquire_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stxrb w9, w1, [x2] +; -O1: stxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acquire acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2583,7 +2583,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_acquire_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acquire seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2614,7 +2614,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_release_monotonic_weak: ; -O1: ldxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new release monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2645,7 +2645,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_release_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new release acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2676,7 +2676,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_release_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new release seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2707,7 +2707,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_acq_rel_monotonic_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acq_rel monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2738,7 +2738,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_acq_rel_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acq_rel acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2769,7 +2769,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_acq_rel_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acq_rel seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2800,7 +2800,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_seq_cst_monotonic_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new seq_cst monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2831,7 +2831,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_seq_cst_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new seq_cst acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2862,7 +2862,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_seq_cst_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new seq_cst seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r Index: llvm/test/CodeGen/AArch64/Atomics/aarch64_be-cmpxchg-rcpc.ll =================================================================== --- llvm/test/CodeGen/AArch64/Atomics/aarch64_be-cmpxchg-rcpc.ll +++ llvm/test/CodeGen/AArch64/Atomics/aarch64_be-cmpxchg-rcpc.ll @@ -28,7 +28,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_monotonic_monotonic_weak: ; -O1: ldxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stxrb w9, w1, [x2] +; -O1: stxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new monotonic monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -59,7 +59,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_monotonic_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stxrb w9, w1, [x2] +; -O1: stxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new monotonic acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -90,7 +90,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_monotonic_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new monotonic seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -121,7 +121,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_acquire_monotonic_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stxrb w9, w1, [x2] +; -O1: stxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acquire monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -152,7 +152,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_acquire_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stxrb w9, w1, [x2] +; -O1: stxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acquire acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -183,7 +183,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_acquire_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acquire seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -214,7 +214,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_release_monotonic_weak: ; -O1: ldxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new release monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -245,7 +245,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_release_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new release acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -276,7 +276,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_release_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new release seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -307,7 +307,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_acq_rel_monotonic_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acq_rel monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -338,7 +338,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_acq_rel_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acq_rel acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -369,7 +369,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_acq_rel_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acq_rel seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -400,7 +400,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_seq_cst_monotonic_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new seq_cst monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -431,7 +431,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_seq_cst_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new seq_cst acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -462,7 +462,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_seq_cst_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new seq_cst seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -493,7 +493,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_monotonic_monotonic_weak: ; -O1: ldxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stxrh w9, w1, [x2] +; -O1: stxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new monotonic monotonic, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -524,7 +524,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_monotonic_acquire_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stxrh w9, w1, [x2] +; -O1: stxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new monotonic acquire, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -555,7 +555,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_monotonic_seq_cst_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new monotonic seq_cst, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -586,7 +586,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_acquire_monotonic_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stxrh w9, w1, [x2] +; -O1: stxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new acquire monotonic, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -617,7 +617,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_acquire_acquire_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stxrh w9, w1, [x2] +; -O1: stxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new acquire acquire, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -648,7 +648,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_acquire_seq_cst_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new acquire seq_cst, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -679,7 +679,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_release_monotonic_weak: ; -O1: ldxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new release monotonic, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -710,7 +710,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_release_acquire_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new release acquire, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -741,7 +741,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_release_seq_cst_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new release seq_cst, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -772,7 +772,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_acq_rel_monotonic_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new acq_rel monotonic, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -803,7 +803,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_acq_rel_acquire_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new acq_rel acquire, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -834,7 +834,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_acq_rel_seq_cst_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new acq_rel seq_cst, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -865,7 +865,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_seq_cst_monotonic_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new seq_cst monotonic, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -896,7 +896,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_seq_cst_acquire_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new seq_cst acquire, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -927,7 +927,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_seq_cst_seq_cst_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new seq_cst seq_cst, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -957,7 +957,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_monotonic_monotonic_weak: ; -O1: ldxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stxr w9, w1, [x2] +; -O1: stxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new monotonic monotonic, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -987,7 +987,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_monotonic_acquire_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stxr w9, w1, [x2] +; -O1: stxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new monotonic acquire, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1017,7 +1017,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_monotonic_seq_cst_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new monotonic seq_cst, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1047,7 +1047,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_acquire_monotonic_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stxr w9, w1, [x2] +; -O1: stxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new acquire monotonic, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1077,7 +1077,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_acquire_acquire_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stxr w9, w1, [x2] +; -O1: stxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new acquire acquire, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1107,7 +1107,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_acquire_seq_cst_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new acquire seq_cst, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1137,7 +1137,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_release_monotonic_weak: ; -O1: ldxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new release monotonic, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1167,7 +1167,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_release_acquire_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new release acquire, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1197,7 +1197,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_release_seq_cst_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new release seq_cst, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1227,7 +1227,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_acq_rel_monotonic_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new acq_rel monotonic, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1257,7 +1257,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_acq_rel_acquire_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new acq_rel acquire, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1287,7 +1287,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_acq_rel_seq_cst_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new acq_rel seq_cst, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1317,7 +1317,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_seq_cst_monotonic_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new seq_cst monotonic, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1347,7 +1347,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_seq_cst_acquire_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new seq_cst acquire, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1377,7 +1377,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_seq_cst_seq_cst_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new seq_cst seq_cst, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1407,7 +1407,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_monotonic_monotonic_weak: ; -O1: ldxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stxr w9, x1, [x2] +; -O1: stxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new monotonic monotonic, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1437,7 +1437,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_monotonic_acquire_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stxr w9, x1, [x2] +; -O1: stxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new monotonic acquire, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1467,7 +1467,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_monotonic_seq_cst_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new monotonic seq_cst, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1497,7 +1497,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_acquire_monotonic_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stxr w9, x1, [x2] +; -O1: stxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new acquire monotonic, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1527,7 +1527,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_acquire_acquire_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stxr w9, x1, [x2] +; -O1: stxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new acquire acquire, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1557,7 +1557,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_acquire_seq_cst_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new acquire seq_cst, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1587,7 +1587,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_release_monotonic_weak: ; -O1: ldxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new release monotonic, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1617,7 +1617,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_release_acquire_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new release acquire, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1647,7 +1647,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_release_seq_cst_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new release seq_cst, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1677,7 +1677,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_acq_rel_monotonic_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new acq_rel monotonic, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1707,7 +1707,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_acq_rel_acquire_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new acq_rel acquire, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1737,7 +1737,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_acq_rel_seq_cst_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new acq_rel seq_cst, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1767,7 +1767,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_seq_cst_monotonic_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new seq_cst monotonic, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1797,7 +1797,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_seq_cst_acquire_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new seq_cst acquire, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1827,7 +1827,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_seq_cst_seq_cst_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new seq_cst seq_cst, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -2428,7 +2428,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_monotonic_monotonic_weak: ; -O1: ldxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stxrb w9, w1, [x2] +; -O1: stxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new monotonic monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2459,7 +2459,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_monotonic_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stxrb w9, w1, [x2] +; -O1: stxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new monotonic acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2490,7 +2490,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_monotonic_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new monotonic seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2521,7 +2521,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_acquire_monotonic_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stxrb w9, w1, [x2] +; -O1: stxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acquire monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2552,7 +2552,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_acquire_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stxrb w9, w1, [x2] +; -O1: stxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acquire acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2583,7 +2583,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_acquire_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acquire seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2614,7 +2614,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_release_monotonic_weak: ; -O1: ldxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new release monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2645,7 +2645,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_release_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new release acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2676,7 +2676,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_release_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new release seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2707,7 +2707,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_acq_rel_monotonic_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acq_rel monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2738,7 +2738,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_acq_rel_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acq_rel acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2769,7 +2769,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_acq_rel_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acq_rel seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2800,7 +2800,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_seq_cst_monotonic_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new seq_cst monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2831,7 +2831,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_seq_cst_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new seq_cst acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2862,7 +2862,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_seq_cst_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new seq_cst seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r Index: llvm/test/CodeGen/AArch64/Atomics/aarch64_be-cmpxchg-rcpc3.ll =================================================================== --- llvm/test/CodeGen/AArch64/Atomics/aarch64_be-cmpxchg-rcpc3.ll +++ llvm/test/CodeGen/AArch64/Atomics/aarch64_be-cmpxchg-rcpc3.ll @@ -28,7 +28,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_monotonic_monotonic_weak: ; -O1: ldxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stxrb w9, w1, [x2] +; -O1: stxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new monotonic monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -59,7 +59,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_monotonic_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stxrb w9, w1, [x2] +; -O1: stxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new monotonic acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -90,7 +90,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_monotonic_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new monotonic seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -121,7 +121,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_acquire_monotonic_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stxrb w9, w1, [x2] +; -O1: stxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acquire monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -152,7 +152,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_acquire_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stxrb w9, w1, [x2] +; -O1: stxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acquire acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -183,7 +183,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_acquire_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acquire seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -214,7 +214,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_release_monotonic_weak: ; -O1: ldxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new release monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -245,7 +245,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_release_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new release acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -276,7 +276,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_release_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new release seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -307,7 +307,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_acq_rel_monotonic_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acq_rel monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -338,7 +338,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_acq_rel_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acq_rel acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -369,7 +369,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_acq_rel_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acq_rel seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -400,7 +400,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_seq_cst_monotonic_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new seq_cst monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -431,7 +431,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_seq_cst_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new seq_cst acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -462,7 +462,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_seq_cst_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new seq_cst seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -493,7 +493,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_monotonic_monotonic_weak: ; -O1: ldxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stxrh w9, w1, [x2] +; -O1: stxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new monotonic monotonic, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -524,7 +524,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_monotonic_acquire_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stxrh w9, w1, [x2] +; -O1: stxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new monotonic acquire, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -555,7 +555,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_monotonic_seq_cst_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new monotonic seq_cst, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -586,7 +586,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_acquire_monotonic_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stxrh w9, w1, [x2] +; -O1: stxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new acquire monotonic, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -617,7 +617,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_acquire_acquire_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stxrh w9, w1, [x2] +; -O1: stxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new acquire acquire, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -648,7 +648,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_acquire_seq_cst_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new acquire seq_cst, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -679,7 +679,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_release_monotonic_weak: ; -O1: ldxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new release monotonic, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -710,7 +710,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_release_acquire_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new release acquire, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -741,7 +741,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_release_seq_cst_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new release seq_cst, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -772,7 +772,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_acq_rel_monotonic_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new acq_rel monotonic, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -803,7 +803,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_acq_rel_acquire_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new acq_rel acquire, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -834,7 +834,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_acq_rel_seq_cst_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new acq_rel seq_cst, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -865,7 +865,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_seq_cst_monotonic_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new seq_cst monotonic, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -896,7 +896,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_seq_cst_acquire_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new seq_cst acquire, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -927,7 +927,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_seq_cst_seq_cst_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new seq_cst seq_cst, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -957,7 +957,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_monotonic_monotonic_weak: ; -O1: ldxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stxr w9, w1, [x2] +; -O1: stxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new monotonic monotonic, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -987,7 +987,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_monotonic_acquire_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stxr w9, w1, [x2] +; -O1: stxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new monotonic acquire, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1017,7 +1017,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_monotonic_seq_cst_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new monotonic seq_cst, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1047,7 +1047,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_acquire_monotonic_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stxr w9, w1, [x2] +; -O1: stxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new acquire monotonic, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1077,7 +1077,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_acquire_acquire_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stxr w9, w1, [x2] +; -O1: stxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new acquire acquire, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1107,7 +1107,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_acquire_seq_cst_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new acquire seq_cst, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1137,7 +1137,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_release_monotonic_weak: ; -O1: ldxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new release monotonic, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1167,7 +1167,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_release_acquire_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new release acquire, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1197,7 +1197,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_release_seq_cst_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new release seq_cst, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1227,7 +1227,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_acq_rel_monotonic_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new acq_rel monotonic, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1257,7 +1257,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_acq_rel_acquire_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new acq_rel acquire, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1287,7 +1287,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_acq_rel_seq_cst_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new acq_rel seq_cst, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1317,7 +1317,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_seq_cst_monotonic_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new seq_cst monotonic, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1347,7 +1347,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_seq_cst_acquire_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new seq_cst acquire, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1377,7 +1377,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_seq_cst_seq_cst_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new seq_cst seq_cst, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1407,7 +1407,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_monotonic_monotonic_weak: ; -O1: ldxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stxr w9, x1, [x2] +; -O1: stxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new monotonic monotonic, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1437,7 +1437,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_monotonic_acquire_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stxr w9, x1, [x2] +; -O1: stxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new monotonic acquire, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1467,7 +1467,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_monotonic_seq_cst_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new monotonic seq_cst, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1497,7 +1497,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_acquire_monotonic_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stxr w9, x1, [x2] +; -O1: stxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new acquire monotonic, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1527,7 +1527,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_acquire_acquire_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stxr w9, x1, [x2] +; -O1: stxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new acquire acquire, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1557,7 +1557,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_acquire_seq_cst_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new acquire seq_cst, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1587,7 +1587,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_release_monotonic_weak: ; -O1: ldxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new release monotonic, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1617,7 +1617,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_release_acquire_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new release acquire, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1647,7 +1647,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_release_seq_cst_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new release seq_cst, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1677,7 +1677,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_acq_rel_monotonic_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new acq_rel monotonic, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1707,7 +1707,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_acq_rel_acquire_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new acq_rel acquire, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1737,7 +1737,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_acq_rel_seq_cst_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new acq_rel seq_cst, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1767,7 +1767,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_seq_cst_monotonic_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new seq_cst monotonic, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1797,7 +1797,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_seq_cst_acquire_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new seq_cst acquire, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1827,7 +1827,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_seq_cst_seq_cst_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new seq_cst seq_cst, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -2428,7 +2428,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_monotonic_monotonic_weak: ; -O1: ldxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stxrb w9, w1, [x2] +; -O1: stxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new monotonic monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2459,7 +2459,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_monotonic_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stxrb w9, w1, [x2] +; -O1: stxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new monotonic acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2490,7 +2490,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_monotonic_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new monotonic seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2521,7 +2521,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_acquire_monotonic_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stxrb w9, w1, [x2] +; -O1: stxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acquire monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2552,7 +2552,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_acquire_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stxrb w9, w1, [x2] +; -O1: stxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acquire acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2583,7 +2583,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_acquire_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acquire seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2614,7 +2614,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_release_monotonic_weak: ; -O1: ldxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new release monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2645,7 +2645,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_release_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new release acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2676,7 +2676,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_release_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new release seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2707,7 +2707,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_acq_rel_monotonic_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acq_rel monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2738,7 +2738,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_acq_rel_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acq_rel acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2769,7 +2769,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_acq_rel_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acq_rel seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2800,7 +2800,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_seq_cst_monotonic_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new seq_cst monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2831,7 +2831,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_seq_cst_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new seq_cst acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2862,7 +2862,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_seq_cst_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new seq_cst seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r Index: llvm/test/CodeGen/AArch64/Atomics/aarch64_be-cmpxchg-v8a.ll =================================================================== --- llvm/test/CodeGen/AArch64/Atomics/aarch64_be-cmpxchg-v8a.ll +++ llvm/test/CodeGen/AArch64/Atomics/aarch64_be-cmpxchg-v8a.ll @@ -28,7 +28,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_monotonic_monotonic_weak: ; -O1: ldxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stxrb w9, w1, [x2] +; -O1: stxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new monotonic monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -59,7 +59,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_monotonic_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stxrb w9, w1, [x2] +; -O1: stxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new monotonic acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -90,7 +90,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_monotonic_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new monotonic seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -121,7 +121,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_acquire_monotonic_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stxrb w9, w1, [x2] +; -O1: stxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acquire monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -152,7 +152,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_acquire_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stxrb w9, w1, [x2] +; -O1: stxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acquire acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -183,7 +183,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_acquire_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acquire seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -214,7 +214,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_release_monotonic_weak: ; -O1: ldxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new release monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -245,7 +245,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_release_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new release acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -276,7 +276,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_release_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new release seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -307,7 +307,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_acq_rel_monotonic_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acq_rel monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -338,7 +338,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_acq_rel_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acq_rel acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -369,7 +369,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_acq_rel_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acq_rel seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -400,7 +400,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_seq_cst_monotonic_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new seq_cst monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -431,7 +431,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_seq_cst_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new seq_cst acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -462,7 +462,7 @@ ; -O1-LABEL: cmpxchg_i8_aligned_seq_cst_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new seq_cst seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -493,7 +493,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_monotonic_monotonic_weak: ; -O1: ldxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stxrh w9, w1, [x2] +; -O1: stxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new monotonic monotonic, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -524,7 +524,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_monotonic_acquire_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stxrh w9, w1, [x2] +; -O1: stxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new monotonic acquire, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -555,7 +555,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_monotonic_seq_cst_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new monotonic seq_cst, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -586,7 +586,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_acquire_monotonic_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stxrh w9, w1, [x2] +; -O1: stxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new acquire monotonic, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -617,7 +617,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_acquire_acquire_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stxrh w9, w1, [x2] +; -O1: stxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new acquire acquire, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -648,7 +648,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_acquire_seq_cst_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new acquire seq_cst, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -679,7 +679,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_release_monotonic_weak: ; -O1: ldxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new release monotonic, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -710,7 +710,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_release_acquire_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new release acquire, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -741,7 +741,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_release_seq_cst_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new release seq_cst, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -772,7 +772,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_acq_rel_monotonic_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new acq_rel monotonic, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -803,7 +803,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_acq_rel_acquire_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new acq_rel acquire, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -834,7 +834,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_acq_rel_seq_cst_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new acq_rel seq_cst, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -865,7 +865,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_seq_cst_monotonic_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new seq_cst monotonic, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -896,7 +896,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_seq_cst_acquire_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new seq_cst acquire, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -927,7 +927,7 @@ ; -O1-LABEL: cmpxchg_i16_aligned_seq_cst_seq_cst_weak: ; -O1: ldaxrh w8, [x2] ; -O1: cmp w8, w0, uxth -; -O1: stlxrh w9, w1, [x2] +; -O1: stlxrh wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new seq_cst seq_cst, align 2 %r = extractvalue { i16, i1 } %pair, 0 ret i16 %r @@ -957,7 +957,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_monotonic_monotonic_weak: ; -O1: ldxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stxr w9, w1, [x2] +; -O1: stxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new monotonic monotonic, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -987,7 +987,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_monotonic_acquire_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stxr w9, w1, [x2] +; -O1: stxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new monotonic acquire, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1017,7 +1017,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_monotonic_seq_cst_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new monotonic seq_cst, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1047,7 +1047,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_acquire_monotonic_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stxr w9, w1, [x2] +; -O1: stxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new acquire monotonic, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1077,7 +1077,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_acquire_acquire_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stxr w9, w1, [x2] +; -O1: stxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new acquire acquire, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1107,7 +1107,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_acquire_seq_cst_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new acquire seq_cst, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1137,7 +1137,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_release_monotonic_weak: ; -O1: ldxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new release monotonic, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1167,7 +1167,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_release_acquire_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new release acquire, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1197,7 +1197,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_release_seq_cst_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new release seq_cst, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1227,7 +1227,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_acq_rel_monotonic_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new acq_rel monotonic, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1257,7 +1257,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_acq_rel_acquire_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new acq_rel acquire, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1287,7 +1287,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_acq_rel_seq_cst_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new acq_rel seq_cst, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1317,7 +1317,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_seq_cst_monotonic_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new seq_cst monotonic, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1347,7 +1347,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_seq_cst_acquire_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new seq_cst acquire, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1377,7 +1377,7 @@ ; -O1-LABEL: cmpxchg_i32_aligned_seq_cst_seq_cst_weak: ; -O1: ldaxr w8, [x2] ; -O1: cmp w8, w0 -; -O1: stlxr w9, w1, [x2] +; -O1: stlxr wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new seq_cst seq_cst, align 4 %r = extractvalue { i32, i1 } %pair, 0 ret i32 %r @@ -1407,7 +1407,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_monotonic_monotonic_weak: ; -O1: ldxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stxr w9, x1, [x2] +; -O1: stxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new monotonic monotonic, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1437,7 +1437,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_monotonic_acquire_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stxr w9, x1, [x2] +; -O1: stxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new monotonic acquire, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1467,7 +1467,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_monotonic_seq_cst_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new monotonic seq_cst, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1497,7 +1497,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_acquire_monotonic_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stxr w9, x1, [x2] +; -O1: stxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new acquire monotonic, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1527,7 +1527,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_acquire_acquire_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stxr w9, x1, [x2] +; -O1: stxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new acquire acquire, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1557,7 +1557,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_acquire_seq_cst_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new acquire seq_cst, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1587,7 +1587,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_release_monotonic_weak: ; -O1: ldxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new release monotonic, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1617,7 +1617,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_release_acquire_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new release acquire, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1647,7 +1647,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_release_seq_cst_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new release seq_cst, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1677,7 +1677,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_acq_rel_monotonic_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new acq_rel monotonic, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1707,7 +1707,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_acq_rel_acquire_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new acq_rel acquire, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1737,7 +1737,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_acq_rel_seq_cst_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new acq_rel seq_cst, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1767,7 +1767,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_seq_cst_monotonic_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new seq_cst monotonic, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1797,7 +1797,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_seq_cst_acquire_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new seq_cst acquire, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -1827,7 +1827,7 @@ ; -O1-LABEL: cmpxchg_i64_aligned_seq_cst_seq_cst_weak: ; -O1: ldaxr x8, [x2] ; -O1: cmp x8, x0 -; -O1: stlxr w9, x1, [x2] +; -O1: stlxr wzr, x1, [x2] %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new seq_cst seq_cst, align 8 %r = extractvalue { i64, i1 } %pair, 0 ret i64 %r @@ -2428,7 +2428,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_monotonic_monotonic_weak: ; -O1: ldxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stxrb w9, w1, [x2] +; -O1: stxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new monotonic monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2459,7 +2459,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_monotonic_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stxrb w9, w1, [x2] +; -O1: stxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new monotonic acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2490,7 +2490,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_monotonic_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new monotonic seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2521,7 +2521,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_acquire_monotonic_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stxrb w9, w1, [x2] +; -O1: stxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acquire monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2552,7 +2552,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_acquire_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stxrb w9, w1, [x2] +; -O1: stxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acquire acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2583,7 +2583,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_acquire_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acquire seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2614,7 +2614,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_release_monotonic_weak: ; -O1: ldxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new release monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2645,7 +2645,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_release_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new release acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2676,7 +2676,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_release_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new release seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2707,7 +2707,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_acq_rel_monotonic_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acq_rel monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2738,7 +2738,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_acq_rel_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acq_rel acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2769,7 +2769,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_acq_rel_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acq_rel seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2800,7 +2800,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_seq_cst_monotonic_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new seq_cst monotonic, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2831,7 +2831,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_seq_cst_acquire_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new seq_cst acquire, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r @@ -2862,7 +2862,7 @@ ; -O1-LABEL: cmpxchg_i8_unaligned_seq_cst_seq_cst_weak: ; -O1: ldaxrb w8, [x2] ; -O1: cmp w8, w0, uxtb -; -O1: stlxrb w9, w1, [x2] +; -O1: stlxrb wzr, w1, [x2] %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new seq_cst seq_cst, align 1 %r = extractvalue { i8, i1 } %pair, 0 ret i8 %r Index: llvm/test/CodeGen/AArch64/GlobalISel/irtranslator-switch-bittest.ll =================================================================== --- llvm/test/CodeGen/AArch64/GlobalISel/irtranslator-switch-bittest.ll +++ llvm/test/CodeGen/AArch64/GlobalISel/irtranslator-switch-bittest.ll @@ -1,5 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py -; RUN: llc -mtriple aarch64 -aarch64-enable-atomic-cfg-tidy=0 -stop-after=irtranslator -global-isel -verify-machineinstrs %s -o - 2>&1 | FileCheck %s +; RUN: llc -mtriple aarch64 -aarch64-enable-atomic-cfg-tidy=0 -stop-after=irtranslator -global-isel -verify-machineinstrs -disable-cgp-delete-phis %s -o - 2>&1 | FileCheck %s define i32 @test_bittest(i16 %p) { ; CHECK-LABEL: name: test_bittest Index: llvm/test/CodeGen/AArch64/machine_cse.ll =================================================================== --- llvm/test/CodeGen/AArch64/machine_cse.ll +++ llvm/test/CodeGen/AArch64/machine_cse.ll @@ -11,7 +11,7 @@ @d = external global i32 @e = external global i32 -define void @combine-sign-comparisons-by-cse(ptr %arg) { +define i32 @combine-sign-comparisons-by-cse(ptr %arg) { ; CHECK: cmp ; CHECK: b.ge ; CHECK-NOT: cmp @@ -45,7 +45,7 @@ return: %retval.0 = phi i32 [ 0, %if.end ], [ 1, %land.lhs.true3 ], [ 1, %land.lhs.true ] store i32 %a, ptr %arg - ret void + ret i32 %retval.0 } define void @combine_vector_zeros(ptr %p, ptr %q) { Index: llvm/test/CodeGen/Hexagon/autohvx/lower-insert-elt.ll =================================================================== --- llvm/test/CodeGen/Hexagon/autohvx/lower-insert-elt.ll +++ llvm/test/CodeGen/Hexagon/autohvx/lower-insert-elt.ll @@ -1,4 +1,4 @@ -; RUN: llc -march=hexagon < %s | FileCheck %s +; RUN: llc -march=hexagon -disable-cgp-delete-phis < %s | FileCheck %s ; REQUIRES: asserts ; Check that this testcase compiles successfully. Index: llvm/test/CodeGen/Hexagon/postinc-offset.ll =================================================================== --- llvm/test/CodeGen/Hexagon/postinc-offset.ll +++ llvm/test/CodeGen/Hexagon/postinc-offset.ll @@ -1,4 +1,4 @@ -; RUN: llc -enable-aa-sched-mi -march=hexagon -mcpu=hexagonv5 -rdf-opt=0 \ +; RUN: llc -enable-aa-sched-mi -march=hexagon -mcpu=hexagonv5 -rdf-opt=0 -disable-cgp-delete-phis \ ; RUN: < %s | FileCheck %s ; CHECK: { Index: llvm/test/CodeGen/Hexagon/swp-carried-1.ll =================================================================== --- llvm/test/CodeGen/Hexagon/swp-carried-1.ll +++ llvm/test/CodeGen/Hexagon/swp-carried-1.ll @@ -1,4 +1,4 @@ -; RUN: llc -march=hexagon -rdf-opt=0 -disable-hexagon-misched -hexagon-initial-cfg-cleanup=0 -lsr-setupcost-depth-limit=1 < %s -pipeliner-experimental-cg=true | FileCheck %s +; RUN: llc -march=hexagon -rdf-opt=0 -disable-hexagon-misched -hexagon-initial-cfg-cleanup=0 -lsr-setupcost-depth-limit=1 -disable-cgp-delete-phis < %s -pipeliner-experimental-cg=true | FileCheck %s ; Test that we generate the correct code when a loop carried value ; is scheduled one stage earlier than it's use. The code in Index: llvm/test/CodeGen/Hexagon/swp-epilog-phi12.ll =================================================================== --- llvm/test/CodeGen/Hexagon/swp-epilog-phi12.ll +++ llvm/test/CodeGen/Hexagon/swp-epilog-phi12.ll @@ -1,4 +1,4 @@ -; RUN: llc -march=hexagon -hexagon-initial-cfg-cleanup=0 -pipeliner-experimental-cg=true < %s | FileCheck %s +; RUN: llc -march=hexagon -hexagon-initial-cfg-cleanup=0 -pipeliner-experimental-cg=true -disable-cgp-delete-phis < %s | FileCheck %s ; Test epilogue generation when reading loop-carried dependency from a previous ; stage. The first epilogue should read value from iteration N-1 of the kernel. Index: llvm/test/CodeGen/Hexagon/swp-epilog-phi6.ll =================================================================== --- llvm/test/CodeGen/Hexagon/swp-epilog-phi6.ll +++ llvm/test/CodeGen/Hexagon/swp-epilog-phi6.ll @@ -1,4 +1,4 @@ -; RUN: llc -march=hexagon -O2 -debug-only=pipeliner -hexagon-initial-cfg-cleanup=0 < %s -o - 2>&1 > /dev/null | FileCheck %s +; RUN: llc -march=hexagon -O2 -debug-only=pipeliner -hexagon-initial-cfg-cleanup=0 -disable-cgp-delete-phis < %s -o - 2>&1 > /dev/null | FileCheck %s ; REQUIRES: asserts ; Test that the phi in the first epilog block is getter the correct Index: llvm/test/CodeGen/Hexagon/swp-epilog-phi9.ll =================================================================== --- llvm/test/CodeGen/Hexagon/swp-epilog-phi9.ll +++ llvm/test/CodeGen/Hexagon/swp-epilog-phi9.ll @@ -1,4 +1,4 @@ -; RUN: llc -march=hexagon -hexagon-initial-cfg-cleanup=0 < %s | FileCheck %s +; RUN: llc -march=hexagon -hexagon-initial-cfg-cleanup=0 -disable-cgp-delete-phis < %s | FileCheck %s ; Test that we generate the correct Phi name in the last couple of epilog ; blocks, when there are 3 epilog blocks. The Phi was scheduled in stage Index: llvm/test/CodeGen/Hexagon/swp-lots-deps.ll =================================================================== --- llvm/test/CodeGen/Hexagon/swp-lots-deps.ll +++ llvm/test/CodeGen/Hexagon/swp-lots-deps.ll @@ -1,4 +1,4 @@ -; RUN: llc -march=hexagon -enable-pipeliner -stats -o /dev/null < %s 2>&1 -pipeliner-experimental-cg=true | FileCheck %s --check-prefix=STATS +; RUN: llc -march=hexagon -enable-pipeliner -stats -o /dev/null < %s 2>&1 -pipeliner-experimental-cg=true -disable-cgp-delete-phis | FileCheck %s --check-prefix=STATS ; REQUIRES: asserts ; STATS: 1 pipeliner - Number of loops software pipelined Index: llvm/test/CodeGen/Hexagon/swp-prolog-phi.ll =================================================================== --- llvm/test/CodeGen/Hexagon/swp-prolog-phi.ll +++ llvm/test/CodeGen/Hexagon/swp-prolog-phi.ll @@ -1,4 +1,4 @@ -; RUN: llc -march=hexagon -rdf-opt=0 < %s -pipeliner-experimental-cg=true | FileCheck %s +; RUN: llc -march=hexagon -rdf-opt=0 < %s -pipeliner-experimental-cg=true -disable-cgp-delete-phis | FileCheck %s ; Test that we generate the correct name for a value in a prolog block. The ; pipeliner was using an incorrect value for an instruction in the 2nd prolog Index: llvm/test/CodeGen/Hexagon/swp-tfri.ll =================================================================== --- llvm/test/CodeGen/Hexagon/swp-tfri.ll +++ llvm/test/CodeGen/Hexagon/swp-tfri.ll @@ -1,4 +1,4 @@ -; RUN: llc -march=hexagon -enable-pipeliner -hexagon-initial-cfg-cleanup=0 -stats -o /dev/null < %s 2>&1 -pipeliner-experimental-cg=true | FileCheck %s --check-prefix=STATS +; RUN: llc -march=hexagon -enable-pipeliner -hexagon-initial-cfg-cleanup=0 -stats -o /dev/null < %s 2>&1 -pipeliner-experimental-cg=true -disable-cgp-delete-phis | FileCheck %s --check-prefix=STATS ; REQUIRES: asserts ; Check that we handle the case when a value is first defined in the loop. Index: llvm/test/CodeGen/Hexagon/v6-unaligned-spill.ll =================================================================== --- llvm/test/CodeGen/Hexagon/v6-unaligned-spill.ll +++ llvm/test/CodeGen/Hexagon/v6-unaligned-spill.ll @@ -1,4 +1,4 @@ -; RUN: llc -march=hexagon < %s | FileCheck %s +; RUN: llc -march=hexagon -disable-cgp-delete-phis < %s | FileCheck %s ; Test that we no longer generate an unaligned vector store for a spill when ; a function has an alloca. Index: llvm/test/CodeGen/PowerPC/sink-side-effect.ll =================================================================== --- llvm/test/CodeGen/PowerPC/sink-side-effect.ll +++ llvm/test/CodeGen/PowerPC/sink-side-effect.ll @@ -1,5 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py -; RUN: llc -mtriple=powerpc64le -mcpu=pwr9 -verify-machineinstrs < %s | FileCheck %s +; RUN: llc -mtriple=powerpc64le -mcpu=pwr9 -verify-machineinstrs -disable-cgp-delete-phis < %s | FileCheck %s define double @zot(ptr %arg, ptr %arg1, ptr %arg2) { ; CHECK-LABEL: zot: Index: llvm/test/CodeGen/PowerPC/sms-iterator.ll =================================================================== --- llvm/test/CodeGen/PowerPC/sms-iterator.ll +++ llvm/test/CodeGen/PowerPC/sms-iterator.ll @@ -1,6 +1,6 @@ ; REQUIRES: asserts ; RUN: llc < %s -mtriple=powerpc64le-unknown-linux-gnu -verify-machineinstrs\ -; RUN: -mcpu=pwr9 --ppc-enable-pipeliner -debug-only=pipeliner 2>&1 \ +; RUN: -mcpu=pwr9 --ppc-enable-pipeliner -debug-only=pipeliner -disable-cgp-delete-phis 2>&1 \ ; RUN: >/dev/null | FileCheck %s %0 = type { i32, [16 x double] } Index: llvm/test/CodeGen/Thumb2/2011-06-07-TwoAddrEarlyClobber.ll =================================================================== --- llvm/test/CodeGen/Thumb2/2011-06-07-TwoAddrEarlyClobber.ll +++ llvm/test/CodeGen/Thumb2/2011-06-07-TwoAddrEarlyClobber.ll @@ -1,4 +1,4 @@ -; RUN: llc -mtriple=thumbv7-apple-darwin10 -arm-atomic-cfg-tidy=0 < %s | FileCheck %s +; RUN: llc -mtriple=thumbv7-apple-darwin10 -arm-atomic-cfg-tidy=0 -disable-cgp-delete-phis < %s | FileCheck %s %struct.op = type { ptr, ptr, ptr, i32, i16, i16, i8, i8 } Index: llvm/test/CodeGen/X86/2007-01-13-StackPtrIndex.ll =================================================================== --- llvm/test/CodeGen/X86/2007-01-13-StackPtrIndex.ll +++ llvm/test/CodeGen/X86/2007-01-13-StackPtrIndex.ll @@ -59,20 +59,20 @@ ; CHECK-NEXT: je .LBB0_10 ; CHECK-NEXT: .LBB0_3: # %a29b173 ; CHECK-NEXT: # =>This Loop Header: Depth=1 -; CHECK-NEXT: # Child Loop BB0_37 Depth 2 +; CHECK-NEXT: # Child Loop BB0_36 Depth 2 ; CHECK-NEXT: # Child Loop BB0_19 Depth 2 ; CHECK-NEXT: # Child Loop BB0_20 Depth 2 -; CHECK-NEXT: # Child Loop BB0_21 Depth 3 -; CHECK-NEXT: # Child Loop BB0_23 Depth 2 -; CHECK-NEXT: # Child Loop BB0_24 Depth 3 -; CHECK-NEXT: # Child Loop BB0_26 Depth 2 +; CHECK-NEXT: # Child Loop BB0_37 Depth 3 +; CHECK-NEXT: # Child Loop BB0_22 Depth 2 +; CHECK-NEXT: # Child Loop BB0_23 Depth 3 +; CHECK-NEXT: # Child Loop BB0_25 Depth 2 ; CHECK-NEXT: # Child Loop BB0_38 Depth 3 -; CHECK-NEXT: # Child Loop BB0_29 Depth 3 -; CHECK-NEXT: # Child Loop BB0_30 Depth 2 +; CHECK-NEXT: # Child Loop BB0_28 Depth 3 +; CHECK-NEXT: # Child Loop BB0_29 Depth 2 ; CHECK-NEXT: # Child Loop BB0_39 Depth 3 -; CHECK-NEXT: # Child Loop BB0_33 Depth 3 -; CHECK-NEXT: # Child Loop BB0_34 Depth 2 -; CHECK-NEXT: # Child Loop BB0_36 Depth 2 +; CHECK-NEXT: # Child Loop BB0_32 Depth 3 +; CHECK-NEXT: # Child Loop BB0_33 Depth 2 +; CHECK-NEXT: # Child Loop BB0_35 Depth 2 ; CHECK-NEXT: testl %eax, %eax ; CHECK-NEXT: js .LBB0_4 ; CHECK-NEXT: # %bb.17: # %b179 @@ -80,11 +80,11 @@ ; CHECK-NEXT: testq %rdx, %rdx ; CHECK-NEXT: js .LBB0_18 ; CHECK-NEXT: .p2align 4, 0x90 -; CHECK-NEXT: .LBB0_37: # %a30b +; CHECK-NEXT: .LBB0_36: # %a30b ; CHECK-NEXT: # Parent Loop BB0_3 Depth=1 ; CHECK-NEXT: # => This Inner Loop Header: Depth=2 ; CHECK-NEXT: testb %dil, %dil -; CHECK-NEXT: je .LBB0_37 +; CHECK-NEXT: je .LBB0_36 ; CHECK-NEXT: .LBB0_18: # %b188 ; CHECK-NEXT: # in Loop: Header=BB0_3 Depth=1 ; CHECK-NEXT: testb %r8b, %r8b @@ -104,33 +104,33 @@ ; CHECK-NEXT: # in Loop: Header=BB0_3 Depth=1 ; CHECK-NEXT: movl %eax, %r10d ; CHECK-NEXT: orl %esi, %r10d -; CHECK-NEXT: jns .LBB0_26 +; CHECK-NEXT: jns .LBB0_25 ; CHECK-NEXT: .LBB0_6: # %a57b ; CHECK-NEXT: # in Loop: Header=BB0_3 Depth=1 ; CHECK-NEXT: shrl $31, %r9d ; CHECK-NEXT: testb %r9b, %r9b -; CHECK-NEXT: je .LBB0_30 +; CHECK-NEXT: je .LBB0_29 ; CHECK-NEXT: .LBB0_7: # %a66b ; CHECK-NEXT: # in Loop: Header=BB0_3 Depth=1 ; CHECK-NEXT: shrl $31, %r10d ; CHECK-NEXT: testb %r10b, %r10b ; CHECK-NEXT: jne .LBB0_8 ; CHECK-NEXT: .p2align 4, 0x90 -; CHECK-NEXT: .LBB0_34: # %a74b +; CHECK-NEXT: .LBB0_33: # %a74b ; CHECK-NEXT: # Parent Loop BB0_3 Depth=1 ; CHECK-NEXT: # => This Inner Loop Header: Depth=2 ; CHECK-NEXT: testb %dil, %dil -; CHECK-NEXT: jne .LBB0_34 -; CHECK-NEXT: # %bb.35: # %b1582 -; CHECK-NEXT: # in Loop: Header=BB0_34 Depth=2 +; CHECK-NEXT: jne .LBB0_33 +; CHECK-NEXT: # %bb.34: # %b1582 +; CHECK-NEXT: # in Loop: Header=BB0_33 Depth=2 ; CHECK-NEXT: testb %dil, %dil -; CHECK-NEXT: jne .LBB0_34 +; CHECK-NEXT: jne .LBB0_33 ; CHECK-NEXT: .LBB0_8: # %a93b ; CHECK-NEXT: # in Loop: Header=BB0_3 Depth=1 ; CHECK-NEXT: testl %eax, %eax ; CHECK-NEXT: js .LBB0_9 ; CHECK-NEXT: .p2align 4, 0x90 -; CHECK-NEXT: .LBB0_36: # %a97b +; CHECK-NEXT: .LBB0_35: # %a97b ; CHECK-NEXT: # Parent Loop BB0_3 Depth=1 ; CHECK-NEXT: # => This Inner Loop Header: Depth=2 ; CHECK-NEXT: movss {{.*#+}} xmm1 = mem[0],zero,zero,zero @@ -141,108 +141,108 @@ ; CHECK-NEXT: addss %xmm1, %xmm2 ; CHECK-NEXT: movss %xmm2, i6000(%rip) ; CHECK-NEXT: testb %dil, %dil -; CHECK-NEXT: jne .LBB0_36 +; CHECK-NEXT: jne .LBB0_35 ; CHECK-NEXT: jmp .LBB0_9 ; CHECK-NEXT: .p2align 4, 0x90 -; CHECK-NEXT: .LBB0_22: # %b463 +; CHECK-NEXT: .LBB0_21: # %b377 ; CHECK-NEXT: # in Loop: Header=BB0_20 Depth=2 ; CHECK-NEXT: testb %dil, %dil -; CHECK-NEXT: je .LBB0_23 +; CHECK-NEXT: je .LBB0_22 ; CHECK-NEXT: .LBB0_20: # %b341 ; CHECK-NEXT: # Parent Loop BB0_3 Depth=1 ; CHECK-NEXT: # => This Loop Header: Depth=2 -; CHECK-NEXT: # Child Loop BB0_21 Depth 3 +; CHECK-NEXT: # Child Loop BB0_37 Depth 3 ; CHECK-NEXT: testq %rsi, %rsi -; CHECK-NEXT: js .LBB0_22 +; CHECK-NEXT: js .LBB0_21 ; CHECK-NEXT: .p2align 4, 0x90 -; CHECK-NEXT: .LBB0_21: # %a35b +; CHECK-NEXT: .LBB0_37: # %a35b ; CHECK-NEXT: # Parent Loop BB0_3 Depth=1 ; CHECK-NEXT: # Parent Loop BB0_20 Depth=2 ; CHECK-NEXT: # => This Inner Loop Header: Depth=3 ; CHECK-NEXT: testb %dil, %dil -; CHECK-NEXT: je .LBB0_21 -; CHECK-NEXT: jmp .LBB0_22 +; CHECK-NEXT: je .LBB0_37 +; CHECK-NEXT: jmp .LBB0_21 ; CHECK-NEXT: .p2align 4, 0x90 -; CHECK-NEXT: .LBB0_28: # %b1016 -; CHECK-NEXT: # in Loop: Header=BB0_26 Depth=2 +; CHECK-NEXT: .LBB0_27: # %b1016 +; CHECK-NEXT: # in Loop: Header=BB0_25 Depth=2 ; CHECK-NEXT: testq %rsi, %rsi ; CHECK-NEXT: jle .LBB0_6 -; CHECK-NEXT: .LBB0_26: # %b858 +; CHECK-NEXT: .LBB0_25: # %b858 ; CHECK-NEXT: # Parent Loop BB0_3 Depth=1 ; CHECK-NEXT: # => This Loop Header: Depth=2 ; CHECK-NEXT: # Child Loop BB0_38 Depth 3 -; CHECK-NEXT: # Child Loop BB0_29 Depth 3 +; CHECK-NEXT: # Child Loop BB0_28 Depth 3 ; CHECK-NEXT: testq %rdx, %rdx -; CHECK-NEXT: js .LBB0_27 +; CHECK-NEXT: js .LBB0_26 ; CHECK-NEXT: .p2align 4, 0x90 ; CHECK-NEXT: .LBB0_38: # %a53b ; CHECK-NEXT: # Parent Loop BB0_3 Depth=1 -; CHECK-NEXT: # Parent Loop BB0_26 Depth=2 +; CHECK-NEXT: # Parent Loop BB0_25 Depth=2 ; CHECK-NEXT: # => This Inner Loop Header: Depth=3 ; CHECK-NEXT: testb %dil, %dil ; CHECK-NEXT: je .LBB0_38 -; CHECK-NEXT: .LBB0_27: # %b879 -; CHECK-NEXT: # in Loop: Header=BB0_26 Depth=2 +; CHECK-NEXT: .LBB0_26: # %b879 +; CHECK-NEXT: # in Loop: Header=BB0_25 Depth=2 ; CHECK-NEXT: testb %r8b, %r8b -; CHECK-NEXT: jne .LBB0_28 +; CHECK-NEXT: jne .LBB0_27 ; CHECK-NEXT: .p2align 4, 0x90 -; CHECK-NEXT: .LBB0_29: # %a53b1019 +; CHECK-NEXT: .LBB0_28: # %a53b1019 ; CHECK-NEXT: # Parent Loop BB0_3 Depth=1 -; CHECK-NEXT: # Parent Loop BB0_26 Depth=2 +; CHECK-NEXT: # Parent Loop BB0_25 Depth=2 ; CHECK-NEXT: # => This Inner Loop Header: Depth=3 ; CHECK-NEXT: testq %rdx, %rdx -; CHECK-NEXT: jle .LBB0_29 -; CHECK-NEXT: jmp .LBB0_28 +; CHECK-NEXT: jle .LBB0_28 +; CHECK-NEXT: jmp .LBB0_27 ; CHECK-NEXT: .p2align 4, 0x90 -; CHECK-NEXT: .LBB0_32: # %b1263 -; CHECK-NEXT: # in Loop: Header=BB0_30 Depth=2 +; CHECK-NEXT: .LBB0_31: # %b1263 +; CHECK-NEXT: # in Loop: Header=BB0_29 Depth=2 ; CHECK-NEXT: testq %rdx, %rdx ; CHECK-NEXT: jle .LBB0_7 -; CHECK-NEXT: .LBB0_30: # %b1117 +; CHECK-NEXT: .LBB0_29: # %b1117 ; CHECK-NEXT: # Parent Loop BB0_3 Depth=1 ; CHECK-NEXT: # => This Loop Header: Depth=2 ; CHECK-NEXT: # Child Loop BB0_39 Depth 3 -; CHECK-NEXT: # Child Loop BB0_33 Depth 3 +; CHECK-NEXT: # Child Loop BB0_32 Depth 3 ; CHECK-NEXT: testq %rsi, %rsi -; CHECK-NEXT: js .LBB0_31 +; CHECK-NEXT: js .LBB0_30 ; CHECK-NEXT: .p2align 4, 0x90 ; CHECK-NEXT: .LBB0_39: # %a63b ; CHECK-NEXT: # Parent Loop BB0_3 Depth=1 -; CHECK-NEXT: # Parent Loop BB0_30 Depth=2 +; CHECK-NEXT: # Parent Loop BB0_29 Depth=2 ; CHECK-NEXT: # => This Inner Loop Header: Depth=3 ; CHECK-NEXT: testq %rsi, %rsi ; CHECK-NEXT: jle .LBB0_39 -; CHECK-NEXT: .LBB0_31: # %b1139 -; CHECK-NEXT: # in Loop: Header=BB0_30 Depth=2 +; CHECK-NEXT: .LBB0_30: # %b1139 +; CHECK-NEXT: # in Loop: Header=BB0_29 Depth=2 ; CHECK-NEXT: testq %rsi, %rsi -; CHECK-NEXT: jle .LBB0_32 +; CHECK-NEXT: jle .LBB0_31 ; CHECK-NEXT: .p2align 4, 0x90 -; CHECK-NEXT: .LBB0_33: # %a63b1266 +; CHECK-NEXT: .LBB0_32: # %a63b1266 ; CHECK-NEXT: # Parent Loop BB0_3 Depth=1 -; CHECK-NEXT: # Parent Loop BB0_30 Depth=2 +; CHECK-NEXT: # Parent Loop BB0_29 Depth=2 ; CHECK-NEXT: # => This Inner Loop Header: Depth=3 ; CHECK-NEXT: testq %rsi, %rsi -; CHECK-NEXT: jle .LBB0_33 -; CHECK-NEXT: jmp .LBB0_32 +; CHECK-NEXT: jle .LBB0_32 +; CHECK-NEXT: jmp .LBB0_31 ; CHECK-NEXT: .p2align 4, 0x90 -; CHECK-NEXT: .LBB0_25: # %b712 -; CHECK-NEXT: # in Loop: Header=BB0_23 Depth=2 +; CHECK-NEXT: .LBB0_24: # %b712 +; CHECK-NEXT: # in Loop: Header=BB0_22 Depth=2 ; CHECK-NEXT: testb %dil, %dil ; CHECK-NEXT: je .LBB0_5 -; CHECK-NEXT: .LBB0_23: # %b535 +; CHECK-NEXT: .LBB0_22: # %b535 ; CHECK-NEXT: # Parent Loop BB0_3 Depth=1 ; CHECK-NEXT: # => This Loop Header: Depth=2 -; CHECK-NEXT: # Child Loop BB0_24 Depth 3 +; CHECK-NEXT: # Child Loop BB0_23 Depth 3 ; CHECK-NEXT: testq %rdx, %rdx -; CHECK-NEXT: js .LBB0_25 +; CHECK-NEXT: js .LBB0_24 ; CHECK-NEXT: .p2align 4, 0x90 -; CHECK-NEXT: .LBB0_24: # %a45b +; CHECK-NEXT: .LBB0_23: # %a45b ; CHECK-NEXT: # Parent Loop BB0_3 Depth=1 -; CHECK-NEXT: # Parent Loop BB0_23 Depth=2 +; CHECK-NEXT: # Parent Loop BB0_22 Depth=2 ; CHECK-NEXT: # => This Inner Loop Header: Depth=3 ; CHECK-NEXT: testb %dil, %dil -; CHECK-NEXT: je .LBB0_24 -; CHECK-NEXT: jmp .LBB0_25 +; CHECK-NEXT: je .LBB0_23 +; CHECK-NEXT: jmp .LBB0_24 ; CHECK-NEXT: .LBB0_10: # %a109b ; CHECK-NEXT: movq %rbp, %rsp ; CHECK-NEXT: popq %rbp Index: llvm/test/CodeGen/X86/2008-04-28-CoalescerBug.ll =================================================================== --- llvm/test/CodeGen/X86/2008-04-28-CoalescerBug.ll +++ llvm/test/CodeGen/X86/2008-04-28-CoalescerBug.ll @@ -46,7 +46,6 @@ ; CHECK-NEXT: je LBB0_4 ; CHECK-NEXT: ## %bb.8: ## %bb13236 ; CHECK-NEXT: ## in Loop: Header=BB0_4 Depth=1 -; CHECK-NEXT: cmpw $-1, %cx ; CHECK-NEXT: testb %al, %al ; CHECK-NEXT: jne LBB0_4 ; CHECK-NEXT: ## %bb.9: ## %bb13572 Index: llvm/test/CodeGen/X86/avx512-i1test.ll =================================================================== --- llvm/test/CodeGen/X86/avx512-i1test.ll +++ llvm/test/CodeGen/X86/avx512-i1test.ll @@ -1,6 +1,6 @@ ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py -; RUN: llc < %s -mattr=+avx512f | FileCheck %s -; RUN: llc < %s -mattr=+avx512f -mattr=+avx512vl -mattr=+avx512bw -mattr=+avx512dq | FileCheck %s +; RUN: llc < %s -mattr=+avx512f -disable-cgp-delete-phis | FileCheck %s +; RUN: llc < %s -mattr=+avx512f -mattr=+avx512vl -mattr=+avx512bw -mattr=+avx512dq -disable-cgp-delete-phis | FileCheck %s target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-unknown-linux-gnu" Index: llvm/test/CodeGen/X86/ins_subreg_coalesce-3.ll =================================================================== --- llvm/test/CodeGen/X86/ins_subreg_coalesce-3.ll +++ llvm/test/CodeGen/X86/ins_subreg_coalesce-3.ll @@ -1,5 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py -; RUN: llc < %s -mtriple=x86_64-- | FileCheck %s +; RUN: llc < %s -mtriple=x86_64-- -disable-cgp-delete-phis | FileCheck %s %struct.COMPOSITE = type { i8, i16, i16 } %struct.FILE = type { ptr, i32, i32, i16, i16, %struct.__sbuf, i32, ptr, ptr, ptr, ptr, ptr, %struct.__sbuf, ptr, i32, [3 x i8], [1 x i8], %struct.__sbuf, i32, i64 } Index: llvm/test/CodeGen/X86/masked_store.ll =================================================================== --- llvm/test/CodeGen/X86/masked_store.ll +++ llvm/test/CodeGen/X86/masked_store.ll @@ -6268,26 +6268,15 @@ ; From https://reviews.llvm.org/rGf8d9097168b7#1165311 define void @undefshuffle(<8 x i1> %i0, ptr %src, ptr %dst) #0 { ; SSE2-LABEL: undefshuffle: -; SSE2: ## %bb.0: +; SSE2: ## %bb.0: ## %else ; SSE2-NEXT: movaps %xmm0, -{{[0-9]+}}(%rsp) -; SSE2-NEXT: movb $1, %al -; SSE2-NEXT: testb %al, %al -; SSE2-NEXT: testb %al, %al -; SSE2-NEXT: testb %al, %al -; SSE2-NEXT: movzbl -{{[0-9]+}}(%rsp), %ecx -; SSE2-NEXT: testb %al, %al -; SSE2-NEXT: movd %ecx, %xmm0 -; SSE2-NEXT: movzbl -{{[0-9]+}}(%rsp), %ecx -; SSE2-NEXT: testb %al, %al -; SSE2-NEXT: pinsrw $1, %ecx, %xmm0 -; SSE2-NEXT: movl -{{[0-9]+}}(%rsp), %ecx -; SSE2-NEXT: testb %al, %al -; SSE2-NEXT: pinsrw $2, %ecx, %xmm0 ; SSE2-NEXT: movzbl -{{[0-9]+}}(%rsp), %eax -; SSE2-NEXT: movb $1, %cl -; SSE2-NEXT: testb %cl, %cl +; SSE2-NEXT: movd %eax, %xmm0 +; SSE2-NEXT: movzbl -{{[0-9]+}}(%rsp), %eax +; SSE2-NEXT: pinsrw $1, %eax, %xmm0 +; SSE2-NEXT: pinsrw $2, -{{[0-9]+}}(%rsp), %xmm0 +; SSE2-NEXT: movzbl -{{[0-9]+}}(%rsp), %eax ; SSE2-NEXT: pinsrw $3, %eax, %xmm0 -; SSE2-NEXT: testb %cl, %cl ; SSE2-NEXT: psllw $15, %xmm0 ; SSE2-NEXT: packsswb %xmm0, %xmm0 ; SSE2-NEXT: pmovmskb %xmm0, %eax @@ -6349,18 +6338,9 @@ ; SSE2-NEXT: retq ; ; SSE4-LABEL: undefshuffle: -; SSE4: ## %bb.0: -; SSE4-NEXT: movb $1, %al -; SSE4-NEXT: testb %al, %al -; SSE4-NEXT: testb %al, %al -; SSE4-NEXT: testb %al, %al -; SSE4-NEXT: testb %al, %al -; SSE4-NEXT: testb %al, %al -; SSE4-NEXT: testb %al, %al -; SSE4-NEXT: testb %al, %al -; SSE4-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0 -; SSE4-NEXT: testb %al, %al +; SSE4: ## %bb.0: ## %else ; SSE4-NEXT: psllw $15, %xmm0 +; SSE4-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0 ; SSE4-NEXT: packsswb %xmm0, %xmm0 ; SSE4-NEXT: pmovmskb %xmm0, %eax ; SSE4-NEXT: testb $1, %al Index: llvm/test/CodeGen/X86/pr49451.ll =================================================================== --- llvm/test/CodeGen/X86/pr49451.ll +++ llvm/test/CodeGen/X86/pr49451.ll @@ -22,7 +22,6 @@ ; X86-NEXT: je .LBB0_2 ; X86-NEXT: # %bb.3: # %if.end1401 ; X86-NEXT: # in Loop: Header=BB0_1 Depth=1 -; X86-NEXT: testb %dl, %dl ; X86-NEXT: addl %eax, %esi ; X86-NEXT: movw %si, s_2 ; X86-NEXT: movw %bx, s_0 @@ -45,7 +44,6 @@ ; X64-NEXT: je .LBB0_2 ; X64-NEXT: # %bb.3: # %if.end1401 ; X64-NEXT: # in Loop: Header=BB0_1 Depth=1 -; X64-NEXT: testb %cl, %cl ; X64-NEXT: addl %esi, %edx ; X64-NEXT: movw %dx, s_2(%rip) ; X64-NEXT: leal -23090(%rax), %edi Index: llvm/test/CodeGen/X86/pr53990-incorrect-machine-sink.ll =================================================================== --- llvm/test/CodeGen/X86/pr53990-incorrect-machine-sink.ll +++ llvm/test/CodeGen/X86/pr53990-incorrect-machine-sink.ll @@ -7,24 +7,31 @@ ; CHECK-LABEL: test: ; CHECK: # %bb.0: # %entry ; CHECK-NEXT: pushq %rbp +; CHECK-NEXT: pushq %r15 ; CHECK-NEXT: pushq %r14 ; CHECK-NEXT: pushq %rbx +; CHECK-NEXT: pushq %rax ; CHECK-NEXT: movq %rdx, %rbx ; CHECK-NEXT: movl %edi, %ebp ; CHECK-NEXT: movq (%rsi), %r14 -; CHECK-NEXT: xorl %eax, %eax -; CHECK-NEXT: jmpq *.LJTI0_0(,%rax,8) -; CHECK-NEXT: .LBB0_1: # %split.3 -; CHECK-NEXT: testb $1, %bpl -; CHECK-NEXT: je .LBB0_3 -; CHECK-NEXT: # %bb.2: # %clobber -; CHECK-NEXT: callq clobber@PLT -; CHECK-NEXT: .LBB0_3: # %sink +; CHECK-NEXT: movb $1, %r15b +; CHECK-NEXT: jmp .LBB0_1 +; CHECK-NEXT: .p2align 4, 0x90 +; CHECK-NEXT: .LBB0_4: # %sink +; CHECK-NEXT: # in Loop: Header=BB0_1 Depth=1 ; CHECK-NEXT: movq %r14, (%rbx) -; CHECK-NEXT: .LBB0_4: # %latch +; CHECK-NEXT: .LBB0_1: # %loop ; CHECK-NEXT: # =>This Inner Loop Header: Depth=1 -; CHECK-NEXT: xorl %eax, %eax -; CHECK-NEXT: jmpq *.LJTI0_0(,%rax,8) +; CHECK-NEXT: testb %r15b, %r15b +; CHECK-NEXT: jne .LBB0_1 +; CHECK-NEXT: # %bb.2: # %split.3 +; CHECK-NEXT: # in Loop: Header=BB0_1 Depth=1 +; CHECK-NEXT: testb $1, %bpl +; CHECK-NEXT: je .LBB0_4 +; CHECK-NEXT: # %bb.3: # %clobber +; CHECK-NEXT: # in Loop: Header=BB0_1 Depth=1 +; CHECK-NEXT: callq clobber@PLT +; CHECK-NEXT: jmp .LBB0_4 entry: %val = load i64, ptr %p, align 8 br label %loop Index: llvm/test/CodeGen/X86/tail-dup-merge-loop-headers.ll =================================================================== --- llvm/test/CodeGen/X86/tail-dup-merge-loop-headers.ll +++ llvm/test/CodeGen/X86/tail-dup-merge-loop-headers.ll @@ -98,7 +98,7 @@ ; CHECK-NEXT: movl $1, %ebx ; CHECK-NEXT: xorl %eax, %eax ; CHECK-NEXT: testb %al, %al -; CHECK-NEXT: jne .LBB1_27 +; CHECK-NEXT: jne .LBB1_24 ; CHECK-NEXT: # %bb.1: # %if.end19 ; CHECK-NEXT: movl %esi, %ebp ; CHECK-NEXT: movq %rdi, %r15 @@ -109,106 +109,87 @@ ; CHECK-NEXT: movq %r12, %rdi ; CHECK-NEXT: callq cli_calloc@PLT ; CHECK-NEXT: testl %ebp, %ebp -; CHECK-NEXT: je .LBB1_26 +; CHECK-NEXT: je .LBB1_23 ; CHECK-NEXT: # %bb.2: # %if.end19 ; CHECK-NEXT: testl %r13d, %r13d -; CHECK-NEXT: je .LBB1_26 +; CHECK-NEXT: je .LBB1_23 ; CHECK-NEXT: # %bb.3: # %if.end19 ; CHECK-NEXT: movq %rax, %r14 ; CHECK-NEXT: xorl %eax, %eax ; CHECK-NEXT: testb %al, %al -; CHECK-NEXT: jne .LBB1_26 +; CHECK-NEXT: jne .LBB1_23 ; CHECK-NEXT: # %bb.4: # %if.end19 ; CHECK-NEXT: cmpq %r15, %r14 -; CHECK-NEXT: jb .LBB1_26 +; CHECK-NEXT: jb .LBB1_23 ; CHECK-NEXT: # %bb.5: # %if.end50 ; CHECK-NEXT: movq %r14, %rdi ; CHECK-NEXT: movq %r12, %rdx ; CHECK-NEXT: callq memcpy@PLT ; CHECK-NEXT: cmpl $4, %ebx -; CHECK-NEXT: jb .LBB1_29 +; CHECK-NEXT: jb .LBB1_26 ; CHECK-NEXT: # %bb.6: # %shared_preheader -; CHECK-NEXT: movb $32, %dl +; CHECK-NEXT: movb $32, %cl ; CHECK-NEXT: xorl %eax, %eax -; CHECK-NEXT: # implicit-def: $rcx -; CHECK-NEXT: jmp .LBB1_9 +; CHECK-NEXT: jmp .LBB1_8 ; CHECK-NEXT: .p2align 4, 0x90 ; CHECK-NEXT: .LBB1_7: # %merge_predecessor_split -; CHECK-NEXT: # in Loop: Header=BB1_9 Depth=1 -; CHECK-NEXT: movb $32, %dl -; CHECK-NEXT: xorl %esi, %esi -; CHECK-NEXT: .LBB1_8: # %outer_loop_latch -; CHECK-NEXT: # in Loop: Header=BB1_9 Depth=1 -; CHECK-NEXT: movzwl %si, %esi -; CHECK-NEXT: decl %esi -; CHECK-NEXT: movzwl %si, %esi -; CHECK-NEXT: leaq 1(%rcx,%rsi), %rcx -; CHECK-NEXT: .LBB1_9: # %outer_loop_header +; CHECK-NEXT: # in Loop: Header=BB1_8 Depth=1 +; CHECK-NEXT: movb $32, %cl +; CHECK-NEXT: .LBB1_8: # %outer_loop_header ; CHECK-NEXT: # =>This Loop Header: Depth=1 -; CHECK-NEXT: # Child Loop BB1_10 Depth 2 +; CHECK-NEXT: # Child Loop BB1_9 Depth 2 ; CHECK-NEXT: testl %r13d, %r13d -; CHECK-NEXT: je .LBB1_19 +; CHECK-NEXT: je .LBB1_16 ; CHECK-NEXT: .p2align 4, 0x90 -; CHECK-NEXT: .LBB1_10: # %shared_loop_header -; CHECK-NEXT: # Parent Loop BB1_9 Depth=1 +; CHECK-NEXT: .LBB1_9: # %shared_loop_header +; CHECK-NEXT: # Parent Loop BB1_8 Depth=1 ; CHECK-NEXT: # => This Inner Loop Header: Depth=2 ; CHECK-NEXT: testq %r14, %r14 -; CHECK-NEXT: jne .LBB1_28 -; CHECK-NEXT: # %bb.11: # %inner_loop_body -; CHECK-NEXT: # in Loop: Header=BB1_10 Depth=2 +; CHECK-NEXT: jne .LBB1_25 +; CHECK-NEXT: # %bb.10: # %inner_loop_body +; CHECK-NEXT: # in Loop: Header=BB1_9 Depth=2 ; CHECK-NEXT: testl %eax, %eax -; CHECK-NEXT: jns .LBB1_10 -; CHECK-NEXT: # %bb.12: # %if.end96.i -; CHECK-NEXT: # in Loop: Header=BB1_9 Depth=1 +; CHECK-NEXT: jns .LBB1_9 +; CHECK-NEXT: # %bb.11: # %if.end96.i +; CHECK-NEXT: # in Loop: Header=BB1_8 Depth=1 ; CHECK-NEXT: cmpl $3, %r13d -; CHECK-NEXT: jae .LBB1_23 -; CHECK-NEXT: # %bb.13: # %if.end287.i -; CHECK-NEXT: # in Loop: Header=BB1_9 Depth=1 -; CHECK-NEXT: xorl %esi, %esi -; CHECK-NEXT: cmpl $1, %r13d -; CHECK-NEXT: setne %dl +; CHECK-NEXT: jae .LBB1_20 +; CHECK-NEXT: # %bb.12: # %if.end287.i +; CHECK-NEXT: # in Loop: Header=BB1_8 Depth=1 ; CHECK-NEXT: testb %al, %al -; CHECK-NEXT: jne .LBB1_17 -; CHECK-NEXT: # %bb.14: # %if.end308.i -; CHECK-NEXT: # in Loop: Header=BB1_9 Depth=1 +; CHECK-NEXT: # implicit-def: $cl +; CHECK-NEXT: jne .LBB1_8 +; CHECK-NEXT: # %bb.13: # %if.end308.i +; CHECK-NEXT: # in Loop: Header=BB1_8 Depth=1 ; CHECK-NEXT: testb %al, %al ; CHECK-NEXT: je .LBB1_7 -; CHECK-NEXT: # %bb.15: # %if.end335.i -; CHECK-NEXT: # in Loop: Header=BB1_9 Depth=1 -; CHECK-NEXT: xorl %edx, %edx -; CHECK-NEXT: testb %dl, %dl -; CHECK-NEXT: movl $0, %esi +; CHECK-NEXT: # %bb.14: # %if.end335.i +; CHECK-NEXT: # in Loop: Header=BB1_8 Depth=1 +; CHECK-NEXT: xorl %ecx, %ecx +; CHECK-NEXT: testb %cl, %cl ; CHECK-NEXT: jne .LBB1_8 -; CHECK-NEXT: # %bb.16: # %merge_other -; CHECK-NEXT: # in Loop: Header=BB1_9 Depth=1 -; CHECK-NEXT: xorl %esi, %esi -; CHECK-NEXT: jmp .LBB1_18 -; CHECK-NEXT: .p2align 4, 0x90 -; CHECK-NEXT: .LBB1_17: # in Loop: Header=BB1_9 Depth=1 -; CHECK-NEXT: movb %dl, %sil -; CHECK-NEXT: addl $3, %esi -; CHECK-NEXT: .LBB1_18: # %outer_loop_latch -; CHECK-NEXT: # in Loop: Header=BB1_9 Depth=1 -; CHECK-NEXT: # implicit-def: $dl +; CHECK-NEXT: # %bb.15: # %merge_other +; CHECK-NEXT: # in Loop: Header=BB1_8 Depth=1 +; CHECK-NEXT: # implicit-def: $cl ; CHECK-NEXT: jmp .LBB1_8 -; CHECK-NEXT: .LBB1_26: +; CHECK-NEXT: .LBB1_23: ; CHECK-NEXT: movl $1, %ebx -; CHECK-NEXT: jmp .LBB1_27 -; CHECK-NEXT: .LBB1_19: # %while.cond.us1412.i +; CHECK-NEXT: jmp .LBB1_24 +; CHECK-NEXT: .LBB1_16: # %while.cond.us1412.i ; CHECK-NEXT: xorl %eax, %eax ; CHECK-NEXT: testb %al, %al ; CHECK-NEXT: movl $1, %ebx -; CHECK-NEXT: jne .LBB1_21 -; CHECK-NEXT: # %bb.20: # %while.cond.us1412.i -; CHECK-NEXT: decb %dl -; CHECK-NEXT: jne .LBB1_27 -; CHECK-NEXT: .LBB1_21: # %if.end41.us1436.i -; CHECK-NEXT: .LBB1_23: # %if.then99.i +; CHECK-NEXT: jne .LBB1_18 +; CHECK-NEXT: # %bb.17: # %while.cond.us1412.i +; CHECK-NEXT: decb %cl +; CHECK-NEXT: jne .LBB1_24 +; CHECK-NEXT: .LBB1_18: # %if.end41.us1436.i +; CHECK-NEXT: .LBB1_20: # %if.then99.i ; CHECK-NEXT: movq .str.6@GOTPCREL(%rip), %rdi ; CHECK-NEXT: xorl %ebx, %ebx ; CHECK-NEXT: xorl %eax, %eax ; CHECK-NEXT: callq cli_dbgmsg@PLT -; CHECK-NEXT: .LBB1_27: # %cleanup +; CHECK-NEXT: .LBB1_24: # %cleanup ; CHECK-NEXT: movl %ebx, %eax ; CHECK-NEXT: addq $8, %rsp ; CHECK-NEXT: popq %rbx @@ -218,8 +199,8 @@ ; CHECK-NEXT: popq %r15 ; CHECK-NEXT: popq %rbp ; CHECK-NEXT: retq -; CHECK-NEXT: .LBB1_28: # %wunpsect.exit.thread.loopexit389 -; CHECK-NEXT: .LBB1_29: # %wunpsect.exit.thread.loopexit391 +; CHECK-NEXT: .LBB1_25: # %wunpsect.exit.thread.loopexit389 +; CHECK-NEXT: .LBB1_26: # %wunpsect.exit.thread.loopexit391 entry: %0 = load i32, i32* undef, align 4 %mul = shl nsw i32 %0, 2 Index: llvm/test/CodeGen/X86/tail-opts.ll =================================================================== --- llvm/test/CodeGen/X86/tail-opts.ll +++ llvm/test/CodeGen/X86/tail-opts.ll @@ -239,71 +239,39 @@ define fastcc void @c_expand_expr_stmt(ptr %expr) nounwind { ; CHECK-LABEL: c_expand_expr_stmt: ; CHECK: # %bb.0: # %entry -; CHECK-NEXT: pushq %rbx ; CHECK-NEXT: xorl %eax, %eax ; CHECK-NEXT: testb %al, %al -; CHECK-NEXT: jne .LBB3_9 +; CHECK-NEXT: jne .LBB3_8 ; CHECK-NEXT: # %bb.1: # %entry -; CHECK-NEXT: movzbl 0, %ebx ; CHECK-NEXT: xorl %eax, %eax ; CHECK-NEXT: testb %al, %al ; CHECK-NEXT: jne .LBB3_8 ; CHECK-NEXT: # %bb.2: # %bb.i ; CHECK-NEXT: xorl %eax, %eax ; CHECK-NEXT: testb %al, %al -; CHECK-NEXT: je .LBB3_8 +; CHECK-NEXT: jne .LBB3_8 ; CHECK-NEXT: # %bb.3: # %lvalue_p.exit ; CHECK-NEXT: movq 0, %rax ; CHECK-NEXT: movzbl (%rax), %ecx ; CHECK-NEXT: testl %ecx, %ecx -; CHECK-NEXT: je .LBB3_10 +; CHECK-NEXT: je .LBB3_8 ; CHECK-NEXT: # %bb.4: # %lvalue_p.exit ; CHECK-NEXT: cmpl $2, %ecx -; CHECK-NEXT: jne .LBB3_15 +; CHECK-NEXT: jne .LBB3_8 ; CHECK-NEXT: # %bb.5: # %bb.i1 ; CHECK-NEXT: movq 32(%rax), %rax -; CHECK-NEXT: movzbl 16(%rax), %ecx -; CHECK-NEXT: testl %ecx, %ecx -; CHECK-NEXT: je .LBB3_13 +; CHECK-NEXT: movzbl 16(%rax), %eax +; CHECK-NEXT: testl %eax, %eax +; CHECK-NEXT: je .LBB3_8 ; CHECK-NEXT: # %bb.6: # %bb.i1 -; CHECK-NEXT: cmpl $2, %ecx -; CHECK-NEXT: jne .LBB3_15 +; CHECK-NEXT: cmpl $2, %eax +; CHECK-NEXT: jne .LBB3_8 ; CHECK-NEXT: # %bb.7: # %bb.i.i +; CHECK-NEXT: pushq %rax ; CHECK-NEXT: xorl %edi, %edi ; CHECK-NEXT: callq lvalue_p@PLT -; CHECK-NEXT: testl %eax, %eax -; CHECK-NEXT: setne %al -; CHECK-NEXT: jmp .LBB3_16 -; CHECK-NEXT: .LBB3_8: # %bb1 -; CHECK-NEXT: cmpb $23, %bl -; CHECK-NEXT: .LBB3_9: # %bb3 -; CHECK-NEXT: .LBB3_15: -; CHECK-NEXT: xorl %eax, %eax -; CHECK-NEXT: .LBB3_16: # %lvalue_p.exit4 -; CHECK-NEXT: testb %al, %al -; CHECK-NEXT: jne .LBB3_9 -; CHECK-NEXT: # %bb.17: # %lvalue_p.exit4 -; CHECK-NEXT: testb %bl, %bl -; CHECK-NEXT: .LBB3_10: # %bb2.i3 -; CHECK-NEXT: movq 8(%rax), %rax -; CHECK-NEXT: movzbl 16(%rax), %ecx -; CHECK-NEXT: xorl %eax, %eax -; CHECK-NEXT: cmpl $23, %ecx -; CHECK-NEXT: je .LBB3_16 -; CHECK-NEXT: # %bb.11: # %bb2.i3 -; CHECK-NEXT: cmpl $16, %ecx -; CHECK-NEXT: je .LBB3_16 -; CHECK-NEXT: jmp .LBB3_9 -; CHECK-NEXT: .LBB3_13: # %bb2.i.i2 -; CHECK-NEXT: movq 8(%rax), %rax -; CHECK-NEXT: movzbl 16(%rax), %ecx -; CHECK-NEXT: xorl %eax, %eax -; CHECK-NEXT: cmpl $16, %ecx -; CHECK-NEXT: je .LBB3_16 -; CHECK-NEXT: # %bb.14: # %bb2.i.i2 -; CHECK-NEXT: cmpl $23, %ecx -; CHECK-NEXT: je .LBB3_16 -; CHECK-NEXT: jmp .LBB3_9 +; CHECK-NEXT: addq $8, %rsp +; CHECK-NEXT: .LBB3_8: # %bb3 entry: %tmp4 = load i8, ptr null, align 8 ; [#uses=3] switch i8 %tmp4, label %bb3 [ Index: llvm/test/CodeGen/X86/x86-shrink-wrapping.ll =================================================================== --- llvm/test/CodeGen/X86/x86-shrink-wrapping.ll +++ llvm/test/CodeGen/X86/x86-shrink-wrapping.ll @@ -1,7 +1,7 @@ ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py -; RUN: llc %s -o - -enable-shrink-wrap=true -pass-remarks-output=%t | FileCheck %s --check-prefix=ENABLE +; RUN: llc %s -o - -enable-shrink-wrap=true -pass-remarks-output=%t -disable-cgp-delete-phis | FileCheck %s --check-prefix=ENABLE ; RUN: cat %t | FileCheck %s --check-prefix=REMARKS -; RUN: llc %s -o - -enable-shrink-wrap=false | FileCheck %s --check-prefix=DISABLE +; RUN: llc %s -o - -enable-shrink-wrap=false -disable-cgp-delete-phis | FileCheck %s --check-prefix=DISABLE ; ; Note: Lots of tests use inline asm instead of regular calls. ; This allows to have a better control on what the allocation will do. Index: llvm/test/Other/codegenprepare-and-debug.ll =================================================================== --- llvm/test/Other/codegenprepare-and-debug.ll +++ llvm/test/Other/codegenprepare-and-debug.ll @@ -61,6 +61,10 @@ lbl: ; preds = %sw.bb, %while.cond.lbl_crit_edge %var03.1 = phi i32 [ 0, %while.cond.lbl_crit_edge ], [ 3, %sw.bb ] + br label %phi_use + +phi_use: + store i32 %var03.1, ptr %arg0 unreachable } Index: llvm/test/Transforms/CodeGenPrepare/X86/computedgoto.ll =================================================================== --- llvm/test/Transforms/CodeGenPrepare/X86/computedgoto.ll +++ llvm/test/Transforms/CodeGenPrepare/X86/computedgoto.ll @@ -166,14 +166,14 @@ ; Make sure we do the right thing for cases where the indirectbr branches to ; the block it terminates. -define void @loop(ptr nocapture readonly %p) { +define i64 @loop(ptr nocapture readonly %p) { ; CHECK-LABEL: @loop( ; CHECK-NEXT: entry: ; CHECK-NEXT: br label [[DOTSPLIT:%.*]] ; CHECK: bb0: ; CHECK-NEXT: br label [[DOTSPLIT]] ; CHECK: .split: -; CHECK-NEXT: [[MERGE:%.*]] = phi i64 [ [[I_NEXT:%.*]], [[BB0:%.*]] ], [ 0, [[BB0_CLONE:%.*]] ] +; CHECK-NEXT: [[MERGE:%.*]] = phi i64 [ [[I_NEXT:%.*]], [[BB0:%.*]] ], [ 0, [[ENTRY:%.*]] ] ; CHECK-NEXT: [[TMP0:%.*]] = getelementptr inbounds i64, ptr [[P:%.*]], i64 [[MERGE]] ; CHECK-NEXT: store i64 [[MERGE]], ptr [[TMP0]], align 4 ; CHECK-NEXT: [[I_NEXT]] = add nuw nsw i64 [[MERGE]], 1 @@ -182,7 +182,7 @@ ; CHECK-NEXT: [[TARGET:%.*]] = load ptr, ptr [[ARRAYIDX]], align 8 ; CHECK-NEXT: indirectbr ptr [[TARGET]], [label [[BB0]], label %bb1] ; CHECK: bb1: -; CHECK-NEXT: ret void +; CHECK-NEXT: ret i64 [[I_NEXT]] ; entry: br label %bb0 @@ -198,7 +198,7 @@ indirectbr ptr %target, [label %bb0, label %bb1] bb1: - ret void + ret i64 %i.next } ; Don't do anything for cases that contain no phis. @@ -267,7 +267,7 @@ ; CHECK-NEXT: br label [[EXIT]] ; CHECK: exit: ; CHECK-NEXT: [[V:%.*]] = phi i32 [ [[R0]], [[BB0]] ], [ [[R1]], [[BB1:%.*]] ] -; CHECK-NEXT: ret i32 0 +; CHECK-NEXT: ret i32 [[V]] ; { entry: @@ -288,5 +288,5 @@ exit: %v = phi i32 [%r0, %bb0], [%r1, %bb1] - ret i32 0 + ret i32 %v } Index: llvm/test/Transforms/CodeGenPrepare/X86/delete-assume-dead-code.ll =================================================================== --- llvm/test/Transforms/CodeGenPrepare/X86/delete-assume-dead-code.ll +++ llvm/test/Transforms/CodeGenPrepare/X86/delete-assume-dead-code.ll @@ -32,9 +32,7 @@ ; CHECK-NEXT: br label [[HEADER:%.*]] ; CHECK: header: ; CHECK-NEXT: [[IV:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[IV_INC:%.*]], [[HEADER]] ] -; CHECK-NEXT: [[IV2:%.*]] = phi i32 [ 0, [[ENTRY]] ], [ [[IV2_INC:%.*]], [[HEADER]] ] ; CHECK-NEXT: [[IV_INC]] = add i32 [[IV]], 1 -; CHECK-NEXT: [[IV2_INC]] = add i32 [[IV2]], 1 ; CHECK-NEXT: [[CMP:%.*]] = icmp eq i32 [[IV]], [[N:%.*]] ; CHECK-NEXT: br i1 [[CMP]], label [[EXIT:%.*]], label [[HEADER]] ; CHECK: exit: @@ -63,9 +61,7 @@ ; CHECK-NEXT: br label [[HEADER:%.*]] ; CHECK: header: ; CHECK-NEXT: [[IV:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[IV_INC:%.*]], [[HEADER]] ] -; CHECK-NEXT: [[IV2:%.*]] = phi i32 [ 0, [[ENTRY]] ], [ [[IV2_INC:%.*]], [[HEADER]] ] ; CHECK-NEXT: [[IV_INC]] = add i32 [[IV]], 1 -; CHECK-NEXT: [[IV2_INC]] = add i32 [[IV2]], 1 ; CHECK-NEXT: [[CMP:%.*]] = icmp eq i32 [[IV]], [[N:%.*]] ; CHECK-NEXT: br i1 [[CMP]], label [[EXIT:%.*]], label [[HEADER]] ; CHECK: exit: @@ -95,9 +91,7 @@ ; CHECK-NEXT: br label [[HEADER:%.*]] ; CHECK: header: ; CHECK-NEXT: [[IV:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[IV_INC:%.*]], [[HEADER]] ] -; CHECK-NEXT: [[IV2:%.*]] = phi i32 [ 0, [[ENTRY]] ], [ [[IV2_INC:%.*]], [[HEADER]] ] ; CHECK-NEXT: [[IV_INC]] = add i32 [[IV]], 1 -; CHECK-NEXT: [[IV2_INC]] = add i32 [[IV2]], 1 ; CHECK-NEXT: [[CMP:%.*]] = icmp eq i32 [[IV]], [[N:%.*]] ; CHECK-NEXT: br i1 [[CMP]], label [[EXIT:%.*]], label [[HEADER]] ; CHECK: exit: Index: llvm/test/Transforms/CodeGenPrepare/X86/sink-addrmode-base.ll =================================================================== --- llvm/test/Transforms/CodeGenPrepare/X86/sink-addrmode-base.ll +++ llvm/test/Transforms/CodeGenPrepare/X86/sink-addrmode-base.ll @@ -1,5 +1,5 @@ -; RUN: opt -S -codegenprepare -disable-complex-addr-modes=false -addr-sink-new-phis=true -addr-sink-new-select=true %s | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-YES -; RUN: opt -S -codegenprepare -disable-complex-addr-modes=false -addr-sink-new-phis=false -addr-sink-new-select=true %s | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-NO +; RUN: opt -S -codegenprepare -disable-complex-addr-modes=false -addr-sink-new-phis=true -addr-sink-new-select=true -disable-cgp-delete-phis %s | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-YES +; RUN: opt -S -codegenprepare -disable-complex-addr-modes=false -addr-sink-new-phis=false -addr-sink-new-select=true -disable-cgp-delete-phis %s | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-NO target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128" target triple = "x86_64-unknown-linux-gnu" Index: llvm/test/Transforms/CodeGenPrepare/X86/sink-addrmode-two-phi.ll =================================================================== --- llvm/test/Transforms/CodeGenPrepare/X86/sink-addrmode-two-phi.ll +++ llvm/test/Transforms/CodeGenPrepare/X86/sink-addrmode-two-phi.ll @@ -1,4 +1,4 @@ -; RUN: opt -S -codegenprepare -disable-complex-addr-modes=false %s | FileCheck %s --check-prefix=CHECK +; RUN: opt -S -codegenprepare -disable-complex-addr-modes=false -disable-cgp-delete-phis %s | FileCheck %s --check-prefix=CHECK target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128" target triple = "x86_64-unknown-linux-gnu"