Index: llvm/lib/Transforms/Utils/Local.cpp =================================================================== --- llvm/lib/Transforms/Utils/Local.cpp +++ llvm/lib/Transforms/Utils/Local.cpp @@ -131,12 +131,13 @@ // Branch - See if we are conditional jumping on constant if (auto *BI = dyn_cast(T)) { - if (BI->isUnconditional()) return false; // Can't optimize uncond branch + if (BI->isUnconditional()) + return false; // Can't optimize uncond branch BasicBlock *Dest1 = BI->getSuccessor(0); BasicBlock *Dest2 = BI->getSuccessor(1); - if (Dest2 == Dest1) { // Conditional branch to same location? + if (Dest2 == Dest1) { // Conditional branch to same location? // This branch matches something like this: // br bool %cond, label %Dest, label %Dest // and changes it into: br label %Dest @@ -227,9 +228,9 @@ // Remove weight for this case. std::swap(Weights[Idx + 1], Weights.back()); Weights.pop_back(); - SI->setMetadata(LLVMContext::MD_prof, - MDBuilder(BB->getContext()). - createBranchWeights(Weights)); + SI->setMetadata( + LLVMContext::MD_prof, + MDBuilder(BB->getContext()).createBranchWeights(Weights)); } // Remove this entry. BasicBlock *ParentBB = SI->getParent(); @@ -306,12 +307,11 @@ // instruction if it has only one non-default destination. auto FirstCase = *SI->case_begin(); Value *Cond = Builder.CreateICmpEQ(SI->getCondition(), - FirstCase.getCaseValue(), "cond"); + FirstCase.getCaseValue(), "cond"); // Insert the new branch. - BranchInst *NewBr = Builder.CreateCondBr(Cond, - FirstCase.getCaseSuccessor(), - SI->getDefaultDest()); + BranchInst *NewBr = Builder.CreateCondBr( + Cond, FirstCase.getCaseSuccessor(), SI->getDefaultDest()); SmallVector Weights; if (extractBranchWeights(*SI, Weights) && Weights.size() == 2) { uint32_t DefWeight = Weights[0]; @@ -337,7 +337,7 @@ if (auto *IBI = dyn_cast(T)) { // indirectbr blockaddress(@F, @BB) -> br label @BB if (auto *BA = - dyn_cast(IBI->getAddress()->stripPointerCasts())) { + dyn_cast(IBI->getAddress()->stripPointerCasts())) { BasicBlock *TheOnlyDest = BA->getBasicBlock(); SmallSet RemovedSuccessors; @@ -637,7 +637,7 @@ bool llvm::RecursivelyDeleteDeadPHINode(PHINode *PN, const TargetLibraryInfo *TLI, llvm::MemorySSAUpdater *MSSAU) { - SmallPtrSet Visited; + SmallPtrSet Visited; for (Instruction *I = PN; areAllUsesEqual(I) && !I->mayHaveSideEffects(); I = cast(*I->user_begin())) { if (I->use_empty()) @@ -658,8 +658,7 @@ static bool simplifyAndDCEInstruction(Instruction *I, SmallSetVector &WorkList, - const DataLayout &DL, - const TargetLibraryInfo *TLI) { + const DataLayout &DL, const TargetLibraryInfo *TLI) { if (isInstructionTriviallyDead(I, TLI)) { salvageDebugInfo(*I); @@ -761,7 +760,8 @@ while (PHINode *PN = dyn_cast(DestBB->begin())) { Value *NewVal = PN->getIncomingValue(0); // Replace self referencing PHI with poison, it must be dead. - if (NewVal == PN) NewVal = PoisonValue::get(PN->getType()); + if (NewVal == PN) + NewVal = PoisonValue::get(PN->getType()); PN->replaceAllUsesWith(NewVal); PN->eraseFromParent(); } @@ -796,9 +796,9 @@ if (DestBB->hasAddressTaken()) { BlockAddress *BA = BlockAddress::get(DestBB); Constant *Replacement = - ConstantInt::get(Type::getInt32Ty(BA->getContext()), 1); - BA->replaceAllUsesWith(ConstantExpr::getIntToPtr(Replacement, - BA->getType())); + ConstantInt::get(Type::getInt32Ty(BA->getContext()), 1); + BA->replaceAllUsesWith( + ConstantExpr::getIntToPtr(Replacement, BA->getType())); BA->destroyConstant(); } @@ -847,17 +847,17 @@ /// branch to Succ, into Succ. /// /// Assumption: Succ is the single successor for BB. -static bool CanPropagatePredecessorsForPHIs(BasicBlock *BB, BasicBlock *Succ) { +static bool +CanPropagatePredecessorsForPHIs(BasicBlock *BB, BasicBlock *Succ, + const SmallPtrSetImpl &BBPreds) { assert(*succ_begin(BB) == Succ && "Succ is not successor of BB!"); LLVM_DEBUG(dbgs() << "Looking to fold " << BB->getName() << " into " << Succ->getName() << "\n"); // Shortcut, if there is only a single predecessor it must be BB and merging // is always safe - if (Succ->getSinglePredecessor()) return true; - - // Make a list of the predecessors of BB - SmallPtrSet BBPreds(pred_begin(BB), pred_end(BB)); + if (Succ->getSinglePredecessor()) + return true; // Look at all the phi nodes in Succ, to see if they present a conflict when // merging these blocks @@ -883,7 +883,7 @@ } } } else { - Value* Val = PN->getIncomingValueForBlock(BB); + Value *Val = PN->getIncomingValueForBlock(BB); for (unsigned PI = 0, PE = PN->getNumIncomingValues(); PI != PE; ++PI) { // See if the incoming value for the common predecessor is equal to the // one for BB, in which case this phi node will not prevent the merging @@ -931,7 +931,8 @@ } IncomingValueMap::const_iterator It = IncomingValues.find(BB); - if (It != IncomingValues.end()) return It->second; + if (It != IncomingValues.end()) + return It->second; return OldVal; } @@ -966,7 +967,8 @@ for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i) { Value *V = PN->getIncomingValue(i); - if (!isa(V)) continue; + if (!isa(V)) + continue; BasicBlock *BB = PN->getIncomingBlock(i); IncomingValueMap::const_iterator It = IncomingValues.find(BB); @@ -997,6 +999,35 @@ } } +// Only when they shares a single common predecessor, return true. +// Only handles cases when BB can't be merged while its predecessors can be +// redirected. +static bool +CanRedirectPredsOfEmptyBBToSucc(BasicBlock *BB, BasicBlock *Succ, + const SmallPtrSetImpl &BBPreds, + const SmallPtrSetImpl &SuccPreds, + BasicBlock *&CommonPred) { + + // There must be phis in BB, else BB can be merged directly + if (BB->phis().empty() || Succ->phis().empty()) + return false; + + // BB must have predecessors not shared that can be redirected to Succ + if (!BB->hasNPredecessorsOrMore(2)) + return false; + + // Get single common predecessors of both BB and Succ + for (BasicBlock *SuccPred : SuccPreds) { + if (BBPreds.count(SuccPred)) { + if (CommonPred) + return false; + CommonPred = SuccPred; + } + } + + return true; +} + /// Replace a value flowing from a block to a phi with /// potentially multiple instances of that value flowing from the /// block's predecessors to the phi. @@ -1004,9 +1035,11 @@ /// \param BB The block with the value flowing into the phi. /// \param BBPreds The predecessors of BB. /// \param PN The phi that we are updating. +/// \param CommonPred The common predecessor of BB and PN's BasicBlock static void redirectValuesFromPredecessorsToPhi(BasicBlock *BB, const PredBlockVector &BBPreds, - PHINode *PN) { + PHINode *PN, + BasicBlock *CommonPred) { Value *OldVal = PN->removeIncomingValue(BB, false); assert(OldVal && "No entry in PHI for Pred BB!"); @@ -1034,26 +1067,39 @@ // will trigger asserts if we try to clean it up now, without also // simplifying the corresponding conditional branch). BasicBlock *PredBB = OldValPN->getIncomingBlock(i); + + if (PredBB == CommonPred) + continue; + Value *PredVal = OldValPN->getIncomingValue(i); - Value *Selected = selectIncomingValueForBlock(PredVal, PredBB, - IncomingValues); + Value *Selected = + selectIncomingValueForBlock(PredVal, PredBB, IncomingValues); // And add a new incoming value for this predecessor for the // newly retargeted branch. PN->addIncoming(Selected, PredBB); } + if (CommonPred) + PN->addIncoming(OldValPN->getIncomingValueForBlock(CommonPred), BB); + } else { for (unsigned i = 0, e = BBPreds.size(); i != e; ++i) { // Update existing incoming values in PN for this // predecessor of BB. BasicBlock *PredBB = BBPreds[i]; - Value *Selected = selectIncomingValueForBlock(OldVal, PredBB, - IncomingValues); + + if (PredBB == CommonPred) + continue; + + Value *Selected = + selectIncomingValueForBlock(OldVal, PredBB, IncomingValues); // And add a new incoming value for this predecessor for the // newly retargeted branch. PN->addIncoming(Selected, PredBB); } + if (CommonPred) + PN->addIncoming(OldVal, BB); } replaceUndefValuesInPhi(PN, IncomingValues); @@ -1064,13 +1110,30 @@ assert(BB != &BB->getParent()->getEntryBlock() && "TryToSimplifyUncondBranchFromEmptyBlock called on entry block!"); - // We can't eliminate infinite loops. + // We can't simplify infinite loops. BasicBlock *Succ = cast(BB->getTerminator())->getSuccessor(0); - if (BB == Succ) return false; + if (BB == Succ) + return false; - // Check to see if merging these blocks would cause conflicts for any of the - // phi nodes in BB or Succ. If not, we can safely merge. - if (!CanPropagatePredecessorsForPHIs(BB, Succ)) return false; + SmallPtrSet BBPreds(pred_begin(BB), pred_end(BB)); + SmallPtrSet SuccPreds(pred_begin(Succ), pred_end(Succ)); + + // Find the single common predecessor of BB and Succ + BasicBlock *CommonPred = nullptr; + + bool BBKillable = CanPropagatePredecessorsForPHIs(BB, Succ, BBPreds); + + // Only when we can not fold bB into Succ, can we only redirect the + // predecessors of BB to Succ + bool BBPhisMergeable = + BBKillable || + CanRedirectPredsOfEmptyBBToSucc(BB, Succ, BBPreds, SuccPreds, CommonPred); + + if (!BBKillable && !BBPhisMergeable) + return false; + + // Check to see if merging these blocks/phis would cause conflicts for any of + // the phi nodes in BB or Succ. If not, we can safely merge. // Check for cases where Succ has multiple predecessors and a PHI node in BB // has uses which will not disappear when the PHI nodes are merged. It is @@ -1084,11 +1147,12 @@ // Note that if this check finds a live use, BB dominates Succ, so BB is // something like a loop pre-header (or rarely, a part of an irreducible CFG); // folding the branch isn't profitable in that case anyway. + if (!Succ->getSinglePredecessor()) { BasicBlock::iterator BBI = BB->begin(); while (isa(*BBI)) { for (Use &U : BBI->uses()) { - if (PHINode* PN = dyn_cast(U.getUser())) { + if (PHINode *PN = dyn_cast(U.getUser())) { if (PN->getIncomingBlock(U) != BB) return false; } else { @@ -1099,6 +1163,11 @@ } } + if (BBPhisMergeable) + LLVM_DEBUG(dbgs() << "Found Common Predecessor between: " << BB->getName() + << " and " << Succ->getName() << " : " + << CommonPred->getName() << "\n"); + // 'BB' and 'BB->Pred' are loop latches, bail out to presrve inner loop // metadata. // @@ -1171,25 +1240,29 @@ if (PredTI->hasMetadata(LLVMContext::MD_loop)) return false; - LLVM_DEBUG(dbgs() << "Killing Trivial BB: \n" << *BB); + if (BBKillable) + LLVM_DEBUG(dbgs() << "Killing Trivial BB: \n" << *BB); + else if (BBPhisMergeable) + LLVM_DEBUG(dbgs() << "Merge Phis in Trivial BB: \n" << *BB); SmallVector Updates; + if (DTU) { // To avoid processing the same predecessor more than once. - SmallPtrSet SeenPreds; - // All predecessors of BB will be moved to Succ. - SmallPtrSet PredsOfSucc(pred_begin(Succ), pred_end(Succ)); + // All predecessors of BB (except the common predecessor) will be moved to + // Succ. Updates.reserve(Updates.size() + 2 * pred_size(BB) + 1); - for (auto *PredOfBB : predecessors(BB)) - // This predecessor of BB may already have Succ as a successor. - if (!PredsOfSucc.contains(PredOfBB)) - if (SeenPreds.insert(PredOfBB).second) - Updates.push_back({DominatorTree::Insert, PredOfBB, Succ}); - SeenPreds.clear(); - for (auto *PredOfBB : predecessors(BB)) - if (SeenPreds.insert(PredOfBB).second) + + for (auto *PredOfBB : BBPreds) { + // Do not changed those common predecessors of BB and Succ + if (!SuccPreds.contains(PredOfBB)) { + Updates.push_back({DominatorTree::Insert, PredOfBB, Succ}); Updates.push_back({DominatorTree::Delete, PredOfBB, BB}); - Updates.push_back({DominatorTree::Delete, BB, Succ}); + } + } + + if (BBKillable) + Updates.push_back({DominatorTree::Delete, BB, Succ}); } if (isa(Succ->begin())) { @@ -1201,21 +1274,19 @@ // Loop over all of the PHI nodes in the successor of BB. for (BasicBlock::iterator I = Succ->begin(); isa(I); ++I) { PHINode *PN = cast(I); - - redirectValuesFromPredecessorsToPhi(BB, BBPreds, PN); + redirectValuesFromPredecessorsToPhi(BB, BBPreds, PN, CommonPred); } } if (Succ->getSinglePredecessor()) { // BB is the only predecessor of Succ, so Succ will end up with exactly // the same predecessors BB had. - // Copy over any phi, debug or lifetime instruction. BB->getTerminator()->eraseFromParent(); Succ->splice(Succ->getFirstNonPHI()->getIterator(), BB); } else { while (PHINode *PN = dyn_cast(&BB->front())) { - // We explicitly check for such uses in CanPropagatePredecessorsForPHIs. + // We explicitly check for such uses for merging phis. assert(PN->use_empty() && "There shouldn't be any uses here!"); PN->eraseFromParent(); } @@ -1228,21 +1299,35 @@ for (BasicBlock *Pred : predecessors(BB)) Pred->getTerminator()->setMetadata(LLVMContext::MD_loop, LoopMD); - // Everything that jumped to BB now goes to Succ. - BB->replaceAllUsesWith(Succ); - if (!Succ->hasName()) Succ->takeName(BB); - - // Clear the successor list of BB to match updates applying to DTU later. - if (BB->getTerminator()) - BB->back().eraseFromParent(); - new UnreachableInst(BB->getContext(), BB); - assert(succ_empty(BB) && "The successor list of BB isn't empty before " - "applying corresponding DTU updates."); + if (BBKillable) { + // Everything that jumped to BB now goes to Succ. + BB->replaceAllUsesWith(Succ); + + if (!Succ->hasName()) + Succ->takeName(BB); + + // Clear the successor list of BB to match updates applying to DTU later. + if (BB->getTerminator()) + BB->back().eraseFromParent(); + + new UnreachableInst(BB->getContext(), BB); + assert(succ_empty(BB) && "The successor list of BB isn't empty before " + "applying corresponding DTU updates."); + } else if (BBPhisMergeable) { + // Everything except CommonPred that jumped to BB now goes to Succ. + BB->replaceUsesWithIf(Succ, [BBPreds, CommonPred](Use &use) -> bool { + if (Instruction *UseInst = dyn_cast(use.getUser())) + return UseInst->getParent() != CommonPred && + BBPreds.contains(UseInst->getParent()); + return false; + }); + } if (DTU) DTU->applyUpdates(Updates); - DeleteDeadBlock(BB, DTU); + if (BBKillable) + DeleteDeadBlock(BB, DTU); return true; } @@ -1456,8 +1541,7 @@ /// /// See if there is a dbg.value intrinsic for DIVar for the PHI node. -static bool PhiHasDebugValue(DILocalVariable *DIVar, - DIExpression *DIExpr, +static bool PhiHasDebugValue(DILocalVariable *DIVar, DIExpression *DIExpr, PHINode *APN) { // Since we can't guarantee that the original dbg.declare intrinsic // is removed by LowerDbgDeclare(), we need to make sure that we are @@ -1560,8 +1644,8 @@ // FIXME: If only referring to a part of the variable described by the // dbg.declare, then we want to insert a dbg.value for the corresponding // fragment. - LLVM_DEBUG(dbgs() << "Failed to convert dbg.declare to dbg.value: " - << *DII << '\n'); + LLVM_DEBUG(dbgs() << "Failed to convert dbg.declare to dbg.value: " << *DII + << '\n'); return; } @@ -1591,8 +1675,8 @@ // FIXME: If only referring to a part of the variable described by the // dbg.declare, then we want to insert a dbg.value for the corresponding // fragment. - LLVM_DEBUG(dbgs() << "Failed to convert dbg.declare to dbg.value: " - << *DII << '\n'); + LLVM_DEBUG(dbgs() << "Failed to convert dbg.declare to dbg.value: " << *DII + << '\n'); return; } @@ -1688,8 +1772,8 @@ } if (Changed) - for (BasicBlock &BB : F) - RemoveRedundantDbgInstrs(&BB); + for (BasicBlock &BB : F) + RemoveRedundantDbgInstrs(&BB); return Changed; } @@ -1900,7 +1984,8 @@ break; DII->replaceVariableLocationOp(&I, Op0); - bool IsValidSalvageExpr = SalvagedExpr->getNumElements() <= MaxExpressionSize; + bool IsValidSalvageExpr = + SalvagedExpr->getNumElements() <= MaxExpressionSize; if (AdditionalValues.empty() && IsValidSalvageExpr) { DII->setExpression(SalvagedExpr); } else if (isa(DII) && IsValidSalvageExpr && @@ -2157,8 +2242,8 @@ DII->moveAfter(&DomPoint); Changed = true; - // Users which otherwise aren't dominated by the replacement value must - // be salvaged or deleted. + // Users which otherwise aren't dominated by the replacement value must + // be salvaged or deleted. } else if (!DT.dominates(&DomPoint, DII)) { UndefOrSalvage.insert(DII); } @@ -2424,7 +2509,7 @@ static bool markAliveBlocks(Function &F, SmallPtrSetImpl &Reachable, DomTreeUpdater *DTU = nullptr) { - SmallVector Worklist; + SmallVector Worklist; BasicBlock *BB = &F.front(); Worklist.push_back(BB); Reachable.insert(BB); @@ -2495,7 +2580,8 @@ // modify the CFG. // Don't touch volatile stores. - if (SI->isVolatile()) continue; + if (SI->isVolatile()) + continue; Value *Ptr = SI->getOperand(1); @@ -2705,75 +2791,74 @@ MDNode *KMD = MD.second; switch (Kind) { - default: - K->setMetadata(Kind, nullptr); // Remove unknown metadata - break; - case LLVMContext::MD_dbg: - llvm_unreachable("getAllMetadataOtherThanDebugLoc returned a MD_dbg"); - case LLVMContext::MD_DIAssignID: - K->mergeDIAssignID(J); - break; - case LLVMContext::MD_tbaa: - K->setMetadata(Kind, MDNode::getMostGenericTBAA(JMD, KMD)); - break; - case LLVMContext::MD_alias_scope: - K->setMetadata(Kind, MDNode::getMostGenericAliasScope(JMD, KMD)); - break; - case LLVMContext::MD_noalias: - case LLVMContext::MD_mem_parallel_loop_access: - K->setMetadata(Kind, MDNode::intersect(JMD, KMD)); - break; - case LLVMContext::MD_access_group: - K->setMetadata(LLVMContext::MD_access_group, - intersectAccessGroups(K, J)); - break; - case LLVMContext::MD_range: - if (DoesKMove || !K->hasMetadata(LLVMContext::MD_noundef)) - K->setMetadata(Kind, MDNode::getMostGenericRange(JMD, KMD)); - break; - case LLVMContext::MD_fpmath: - K->setMetadata(Kind, MDNode::getMostGenericFPMath(JMD, KMD)); - break; - case LLVMContext::MD_invariant_load: - // If K moves, only set the !invariant.load if it is present in both - // instructions. - if (DoesKMove) - K->setMetadata(Kind, JMD); - break; - case LLVMContext::MD_nonnull: - if (DoesKMove || !K->hasMetadata(LLVMContext::MD_noundef)) - K->setMetadata(Kind, JMD); - break; - case LLVMContext::MD_invariant_group: - // Preserve !invariant.group in K. - break; - case LLVMContext::MD_align: - if (DoesKMove || !K->hasMetadata(LLVMContext::MD_noundef)) - K->setMetadata( - Kind, MDNode::getMostGenericAlignmentOrDereferenceable(JMD, KMD)); - break; - case LLVMContext::MD_dereferenceable: - case LLVMContext::MD_dereferenceable_or_null: - if (DoesKMove) - K->setMetadata(Kind, - MDNode::getMostGenericAlignmentOrDereferenceable(JMD, KMD)); - break; - case LLVMContext::MD_preserve_access_index: - // Preserve !preserve.access.index in K. - break; - case LLVMContext::MD_noundef: - // If K does move, keep noundef if it is present in both instructions. - if (DoesKMove) - K->setMetadata(Kind, JMD); - break; - case LLVMContext::MD_nontemporal: - // Preserve !nontemporal if it is present on both instructions. + default: + K->setMetadata(Kind, nullptr); // Remove unknown metadata + break; + case LLVMContext::MD_dbg: + llvm_unreachable("getAllMetadataOtherThanDebugLoc returned a MD_dbg"); + case LLVMContext::MD_DIAssignID: + K->mergeDIAssignID(J); + break; + case LLVMContext::MD_tbaa: + K->setMetadata(Kind, MDNode::getMostGenericTBAA(JMD, KMD)); + break; + case LLVMContext::MD_alias_scope: + K->setMetadata(Kind, MDNode::getMostGenericAliasScope(JMD, KMD)); + break; + case LLVMContext::MD_noalias: + case LLVMContext::MD_mem_parallel_loop_access: + K->setMetadata(Kind, MDNode::intersect(JMD, KMD)); + break; + case LLVMContext::MD_access_group: + K->setMetadata(LLVMContext::MD_access_group, intersectAccessGroups(K, J)); + break; + case LLVMContext::MD_range: + if (DoesKMove || !K->hasMetadata(LLVMContext::MD_noundef)) + K->setMetadata(Kind, MDNode::getMostGenericRange(JMD, KMD)); + break; + case LLVMContext::MD_fpmath: + K->setMetadata(Kind, MDNode::getMostGenericFPMath(JMD, KMD)); + break; + case LLVMContext::MD_invariant_load: + // If K moves, only set the !invariant.load if it is present in both + // instructions. + if (DoesKMove) K->setMetadata(Kind, JMD); - break; - case LLVMContext::MD_prof: - if (DoesKMove) - K->setMetadata(Kind, MDNode::getMergedProfMetadata(KMD, JMD, K, J)); - break; + break; + case LLVMContext::MD_nonnull: + if (DoesKMove || !K->hasMetadata(LLVMContext::MD_noundef)) + K->setMetadata(Kind, JMD); + break; + case LLVMContext::MD_invariant_group: + // Preserve !invariant.group in K. + break; + case LLVMContext::MD_align: + if (DoesKMove || !K->hasMetadata(LLVMContext::MD_noundef)) + K->setMetadata( + Kind, MDNode::getMostGenericAlignmentOrDereferenceable(JMD, KMD)); + break; + case LLVMContext::MD_dereferenceable: + case LLVMContext::MD_dereferenceable_or_null: + if (DoesKMove) + K->setMetadata( + Kind, MDNode::getMostGenericAlignmentOrDereferenceable(JMD, KMD)); + break; + case LLVMContext::MD_preserve_access_index: + // Preserve !preserve.access.index in K. + break; + case LLVMContext::MD_noundef: + // If K does move, keep noundef if it is present in both instructions. + if (DoesKMove) + K->setMetadata(Kind, JMD); + break; + case LLVMContext::MD_nontemporal: + // Preserve !nontemporal if it is present on both instructions. + K->setMetadata(Kind, JMD); + break; + case LLVMContext::MD_prof: + if (DoesKMove) + K->setMetadata(Kind, MDNode::getMergedProfMetadata(KMD, JMD, K, J)); + break; } } // Set !invariant.group from J if J has it. If both instructions have it @@ -2906,11 +2991,11 @@ } unsigned llvm::replaceNonLocalUsesWith(Instruction *From, Value *To) { - assert(From->getType() == To->getType()); - auto *BB = From->getParent(); - unsigned Count = 0; + assert(From->getType() == To->getType()); + auto *BB = From->getParent(); + unsigned Count = 0; - for (Use &U : llvm::make_early_inc_range(From->uses())) { + for (Use &U : llvm::make_early_inc_range(From->uses())) { auto *I = cast(U.getUser()); if (I->getParent() == BB) continue; @@ -3069,9 +3154,7 @@ /// A potential constituent of a bitreverse or bswap expression. See /// collectBitParts for a fuller explanation. struct BitPart { - BitPart(Value *P, unsigned BW) : Provider(P) { - Provenance.resize(BW); - } + BitPart(Value *P, unsigned BW) : Provider(P) { Provenance.resize(BW); } /// The Value that this is a bitreverse/bswap of. Value *Provider; @@ -3360,7 +3443,7 @@ return false; Type *ITy = I->getType(); if (!ITy->isIntOrIntVectorTy() || ITy->getScalarSizeInBits() > 128) - return false; // Can't do integer/elements > 128 bits. + return false; // Can't do integer/elements > 128 bits. // Try to find all the pieces corresponding to the bswap. bool FoundRoot = false; @@ -3573,8 +3656,8 @@ bool Changed = false; // readnone + not convergent implies nosync - if (!F.hasFnAttribute(Attribute::NoSync) && - F.doesNotAccessMemory() && !F.isConvergent()) { + if (!F.hasFnAttribute(Attribute::NoSync) && F.doesNotAccessMemory() && + !F.isConvergent()) { F.setNoSync(); Changed = true; } 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/ARM/jump-table-islands.ll =================================================================== --- llvm/test/CodeGen/ARM/jump-table-islands.ll +++ llvm/test/CodeGen/ARM/jump-table-islands.ll @@ -1,7 +1,9 @@ -; RUN: llc -mtriple=armv7-apple-ios8.0 -o - %s | FileCheck %s +; RUN: llc -arm-atomic-cfg-tidy=0 -mtriple=armv7-apple-ios8.0 -o - %s | FileCheck %s %BigInt = type i8500 +; FIXME: SimplifyCFG optimizes the CFG here, resulting different asm. +; Update is needed. define %BigInt @test_moved_jumptable(i1 %tst, i32 %sw, %BigInt %l) { ; CHECK-LABEL: test_moved_jumptable: Index: llvm/test/Transforms/JumpThreading/codesize-loop.ll =================================================================== --- llvm/test/Transforms/JumpThreading/codesize-loop.ll +++ llvm/test/Transforms/JumpThreading/codesize-loop.ll @@ -42,16 +42,14 @@ ; OVERIDE-NEXT: [[TMP3:%.*]] = mul i32 [[CALL]], [[TMP2]] ; OVERIDE-NEXT: [[TMP4:%.*]] = icmp sgt i32 [[CALL]], 0 ; OVERIDE-NEXT: [[COND_FR:%.*]] = freeze i1 [[TMP4]] -; OVERIDE-NEXT: br i1 [[COND_FR]], label [[COND_END_THREAD]], label [[TMP6:%.*]] +; OVERIDE-NEXT: br i1 [[COND_FR]], label [[TMP5:%.*]], label [[COND_END_THREAD]] +; OVERIDE: 5: +; OVERIDE-NEXT: br label [[COND_END_THREAD]] ; OVERIDE: cond.end.thread: -; OVERIDE-NEXT: [[TMP5:%.*]] = phi i32 [ [[TMP3]], [[COND_END]] ], [ 205962976, [[ENTRY:%.*]] ] -; OVERIDE-NEXT: [[COND3:%.*]] = phi i32 [ [[CALL]], [[COND_END]] ], [ 46, [[ENTRY]] ] -; OVERIDE-NEXT: br label [[TMP6]] -; OVERIDE: 6: -; OVERIDE-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP5]], [[COND_END_THREAD]] ], [ [[TMP3]], [[COND_END]] ] -; OVERIDE-NEXT: [[TMP8:%.*]] = phi i32 [ [[COND3]], [[COND_END_THREAD]] ], [ 0, [[COND_END]] ] -; OVERIDE-NEXT: [[TMP9:%.*]] = mul i32 [[TMP7]], [[TMP8]] -; OVERIDE-NEXT: [[CALL33:%.*]] = tail call i32 (ptr, ...) @printf(ptr nonnull dereferenceable(1) @.str, i32 [[TMP9]]) +; OVERIDE-NEXT: [[TMP6:%.*]] = phi i32 [ [[TMP3]], [[COND_END]] ], [ [[TMP3]], [[TMP5]] ], [ 205962976, [[ENTRY:%.*]] ] +; OVERIDE-NEXT: [[TMP7:%.*]] = phi i32 [ 0, [[COND_END]] ], [ [[CALL]], [[TMP5]] ], [ 46, [[ENTRY]] ] +; OVERIDE-NEXT: [[TMP8:%.*]] = mul i32 [[TMP6]], [[TMP7]] +; OVERIDE-NEXT: [[CALL33:%.*]] = tail call i32 (ptr, ...) @printf(ptr nonnull dereferenceable(1) @.str, i32 [[TMP8]]) ; OVERIDE-NEXT: ret i32 0 ; entry: @@ -90,16 +88,14 @@ ; DEFAULT-NEXT: [[TMP3:%.*]] = mul i32 [[CALL]], [[TMP2]] ; DEFAULT-NEXT: [[TMP4:%.*]] = icmp sgt i32 [[CALL]], 0 ; DEFAULT-NEXT: [[COND_FR:%.*]] = freeze i1 [[TMP4]] -; DEFAULT-NEXT: br i1 [[COND_FR]], label [[COND_END_THREAD]], label [[TMP6:%.*]] +; DEFAULT-NEXT: br i1 [[COND_FR]], label [[TMP5:%.*]], label [[COND_END_THREAD]] +; DEFAULT: 5: +; DEFAULT-NEXT: br label [[COND_END_THREAD]] ; DEFAULT: cond.end.thread: -; DEFAULT-NEXT: [[TMP5:%.*]] = phi i32 [ [[TMP3]], [[COND_END]] ], [ 205962976, [[ENTRY:%.*]] ] -; DEFAULT-NEXT: [[COND3:%.*]] = phi i32 [ [[CALL]], [[COND_END]] ], [ 46, [[ENTRY]] ] -; DEFAULT-NEXT: br label [[TMP6]] -; DEFAULT: 6: -; DEFAULT-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP5]], [[COND_END_THREAD]] ], [ [[TMP3]], [[COND_END]] ] -; DEFAULT-NEXT: [[TMP8:%.*]] = phi i32 [ [[COND3]], [[COND_END_THREAD]] ], [ 0, [[COND_END]] ] -; DEFAULT-NEXT: [[TMP9:%.*]] = mul i32 [[TMP7]], [[TMP8]] -; DEFAULT-NEXT: [[CALL33:%.*]] = tail call i32 (ptr, ...) @printf(ptr nonnull dereferenceable(1) @.str, i32 [[TMP9]]) +; DEFAULT-NEXT: [[TMP6:%.*]] = phi i32 [ [[TMP3]], [[COND_END]] ], [ [[TMP3]], [[TMP5]] ], [ 205962976, [[ENTRY:%.*]] ] +; DEFAULT-NEXT: [[TMP7:%.*]] = phi i32 [ 0, [[COND_END]] ], [ [[CALL]], [[TMP5]] ], [ 46, [[ENTRY]] ] +; DEFAULT-NEXT: [[TMP8:%.*]] = mul i32 [[TMP6]], [[TMP7]] +; DEFAULT-NEXT: [[CALL33:%.*]] = tail call i32 (ptr, ...) @printf(ptr nonnull dereferenceable(1) @.str, i32 [[TMP8]]) ; DEFAULT-NEXT: ret i32 0 ; ; OVERIDE-LABEL: @test_optsize( @@ -115,16 +111,14 @@ ; OVERIDE-NEXT: [[TMP3:%.*]] = mul i32 [[CALL]], [[TMP2]] ; OVERIDE-NEXT: [[TMP4:%.*]] = icmp sgt i32 [[CALL]], 0 ; OVERIDE-NEXT: [[COND_FR:%.*]] = freeze i1 [[TMP4]] -; OVERIDE-NEXT: br i1 [[COND_FR]], label [[COND_END_THREAD]], label [[TMP6:%.*]] +; OVERIDE-NEXT: br i1 [[COND_FR]], label [[TMP5:%.*]], label [[COND_END_THREAD]] +; OVERIDE: 5: +; OVERIDE-NEXT: br label [[COND_END_THREAD]] ; OVERIDE: cond.end.thread: -; OVERIDE-NEXT: [[TMP5:%.*]] = phi i32 [ [[TMP3]], [[COND_END]] ], [ 205962976, [[ENTRY:%.*]] ] -; OVERIDE-NEXT: [[COND3:%.*]] = phi i32 [ [[CALL]], [[COND_END]] ], [ 46, [[ENTRY]] ] -; OVERIDE-NEXT: br label [[TMP6]] -; OVERIDE: 6: -; OVERIDE-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP5]], [[COND_END_THREAD]] ], [ [[TMP3]], [[COND_END]] ] -; OVERIDE-NEXT: [[TMP8:%.*]] = phi i32 [ [[COND3]], [[COND_END_THREAD]] ], [ 0, [[COND_END]] ] -; OVERIDE-NEXT: [[TMP9:%.*]] = mul i32 [[TMP7]], [[TMP8]] -; OVERIDE-NEXT: [[CALL33:%.*]] = tail call i32 (ptr, ...) @printf(ptr nonnull dereferenceable(1) @.str, i32 [[TMP9]]) +; OVERIDE-NEXT: [[TMP6:%.*]] = phi i32 [ [[TMP3]], [[COND_END]] ], [ [[TMP3]], [[TMP5]] ], [ 205962976, [[ENTRY:%.*]] ] +; OVERIDE-NEXT: [[TMP7:%.*]] = phi i32 [ 0, [[COND_END]] ], [ [[CALL]], [[TMP5]] ], [ 46, [[ENTRY]] ] +; OVERIDE-NEXT: [[TMP8:%.*]] = mul i32 [[TMP6]], [[TMP7]] +; OVERIDE-NEXT: [[CALL33:%.*]] = tail call i32 (ptr, ...) @printf(ptr nonnull dereferenceable(1) @.str, i32 [[TMP8]]) ; OVERIDE-NEXT: ret i32 0 ; entry: Index: llvm/test/Transforms/SimplifyCFG/branch-fold.ll =================================================================== --- llvm/test/Transforms/SimplifyCFG/branch-fold.ll +++ llvm/test/Transforms/SimplifyCFG/branch-fold.ll @@ -119,15 +119,13 @@ ; CHECK-LABEL: @common_pred( ; CHECK-NEXT: Pred: ; CHECK-NEXT: call void @dummy() -; CHECK-NEXT: br i1 [[C1:%.*]], label [[COMMONPRED:%.*]], label [[BB:%.*]] +; CHECK-NEXT: br i1 [[C1:%.*]], label [[COMMONPRED:%.*]], label [[SUCC:%.*]] ; CHECK: CommonPred: ; CHECK-NEXT: call void @dummy() -; CHECK-NEXT: br i1 [[C2:%.*]], label [[SUCC:%.*]], label [[BB]] -; CHECK: BB: -; CHECK-NEXT: [[PHI1:%.*]] = phi i8 [ 0, [[PRED:%.*]] ], [ 1, [[COMMONPRED]] ] +; CHECK-NEXT: [[SPEC_SELECT:%.*]] = select i1 [[C2:%.*]], i8 4, i8 1 ; CHECK-NEXT: br label [[SUCC]] ; CHECK: Succ: -; CHECK-NEXT: [[PHI2:%.*]] = phi i8 [ [[PHI1]], [[BB]] ], [ 4, [[COMMONPRED]] ] +; CHECK-NEXT: [[PHI2:%.*]] = phi i8 [ 0, [[PRED:%.*]] ], [ [[SPEC_SELECT]], [[COMMONPRED]] ] ; CHECK-NEXT: ret i8 [[PHI2]] ; Pred: Index: llvm/test/Transforms/SimplifyCFG/merge-phis-in-switch.ll =================================================================== --- llvm/test/Transforms/SimplifyCFG/merge-phis-in-switch.ll +++ llvm/test/Transforms/SimplifyCFG/merge-phis-in-switch.ll @@ -17,12 +17,11 @@ ; CHECK: unreachable: ; CHECK-NEXT: unreachable ; CHECK: case1: -; CHECK-NEXT: br label [[CASE01]] +; CHECK-NEXT: br label [[END]] ; CHECK: case01: -; CHECK-NEXT: [[PHI1:%.*]] = phi i8 [ 2, [[CASE1]] ], [ 1, [[START:%.*]] ] ; CHECK-NEXT: br label [[END]] ; CHECK: end: -; CHECK-NEXT: [[PHI2:%.*]] = phi i8 [ [[PHI1]], [[CASE01]] ], [ 3, [[START]] ] +; CHECK-NEXT: [[PHI2:%.*]] = phi i8 [ 3, [[START:%.*]] ], [ 2, [[CASE1]] ], [ 1, [[CASE01]] ] ; CHECK-NEXT: ret i8 [[PHI2]] ; start: @@ -58,14 +57,13 @@ ; CHECK: unreachable: ; CHECK-NEXT: unreachable ; CHECK: case1: -; CHECK-NEXT: br label [[CASE012]] +; CHECK-NEXT: br label [[END]] ; CHECK: case2: -; CHECK-NEXT: br label [[CASE012]] +; CHECK-NEXT: br label [[END]] ; CHECK: case012: -; CHECK-NEXT: [[PHI1:%.*]] = phi i8 [ 3, [[CASE2]] ], [ 2, [[CASE1]] ], [ 1, [[START:%.*]] ] ; CHECK-NEXT: br label [[END]] ; CHECK: end: -; CHECK-NEXT: [[PHI2:%.*]] = phi i8 [ [[PHI1]], [[CASE012]] ], [ 4, [[START]] ] +; CHECK-NEXT: [[PHI2:%.*]] = phi i8 [ 4, [[START:%.*]] ], [ 3, [[CASE2]] ], [ 2, [[CASE1]] ], [ 1, [[CASE012]] ] ; CHECK-NEXT: ret i8 [[PHI2]] ; start: @@ -105,17 +103,15 @@ ; CHECK: unreachable: ; CHECK-NEXT: unreachable ; CHECK: case1: -; CHECK-NEXT: br label [[CASE012]] +; CHECK-NEXT: br label [[END]] ; CHECK: case2: -; CHECK-NEXT: br label [[CASE012]] +; CHECK-NEXT: br label [[END]] ; CHECK: case012: -; CHECK-NEXT: [[PHI1_1:%.*]] = phi i8 [ 3, [[CASE2]] ], [ 2, [[CASE1]] ], [ 1, [[START:%.*]] ] -; CHECK-NEXT: [[PHI1_2:%.*]] = phi i8 [ 6, [[CASE2]] ], [ 5, [[CASE1]] ], [ 4, [[START]] ] ; CHECK-NEXT: br label [[END]] ; CHECK: end: -; CHECK-NEXT: [[PHI2_1:%.*]] = phi i8 [ [[PHI1_1]], [[CASE012]] ], [ 4, [[START]] ] -; CHECK-NEXT: [[PHI2_2:%.*]] = phi i8 [ [[PHI1_1]], [[CASE012]] ], [ 5, [[START]] ] -; CHECK-NEXT: [[PHI2_3:%.*]] = phi i8 [ [[PHI1_2]], [[CASE012]] ], [ 3, [[START]] ] +; CHECK-NEXT: [[PHI2_1:%.*]] = phi i8 [ 4, [[START:%.*]] ], [ 3, [[CASE2]] ], [ 2, [[CASE1]] ], [ 1, [[CASE012]] ] +; CHECK-NEXT: [[PHI2_2:%.*]] = phi i8 [ 5, [[START]] ], [ 3, [[CASE2]] ], [ 2, [[CASE1]] ], [ 1, [[CASE012]] ] +; CHECK-NEXT: [[PHI2_3:%.*]] = phi i8 [ 3, [[START]] ], [ 6, [[CASE2]] ], [ 5, [[CASE1]] ], [ 4, [[CASE012]] ] ; CHECK-NEXT: call void @use(i8 [[PHI2_1]]) ; CHECK-NEXT: call void @use(i8 [[PHI2_2]]) ; CHECK-NEXT: call void @use(i8 [[PHI2_3]]) @@ -166,19 +162,17 @@ ; CHECK: unreachable: ; CHECK-NEXT: unreachable ; CHECK: case0: -; CHECK-NEXT: br label [[CASE0123]] +; CHECK-NEXT: br label [[END]] ; CHECK: case1: -; CHECK-NEXT: br label [[CASE0123]] +; CHECK-NEXT: br label [[END]] ; CHECK: case2: -; CHECK-NEXT: br label [[CASE0123]] +; CHECK-NEXT: br label [[END]] ; CHECK: case0123: -; CHECK-NEXT: [[PHI1:%.*]] = phi i8 [ 4, [[START:%.*]] ], [ 3, [[CASE2]] ], [ 2, [[CASE1]] ], [ 1, [[CASE0]] ] -; CHECK-NEXT: br label [[CASE01234]] +; CHECK-NEXT: br label [[END]] ; CHECK: case01234: -; CHECK-NEXT: [[PHI2:%.*]] = phi i8 [ [[PHI1]], [[CASE0123]] ], [ 5, [[START]] ] ; CHECK-NEXT: br label [[END]] ; CHECK: end: -; CHECK-NEXT: [[PHI3:%.*]] = phi i8 [ [[PHI2]], [[CASE01234]] ], [ 6, [[START]] ] +; CHECK-NEXT: [[PHI3:%.*]] = phi i8 [ 6, [[START:%.*]] ], [ 3, [[CASE2]] ], [ 2, [[CASE1]] ], [ 1, [[CASE0]] ], [ 4, [[CASE0123]] ], [ 5, [[CASE01234]] ] ; CHECK-NEXT: ret i8 [[PHI3]] ; start: @@ -231,21 +225,19 @@ ; CHECK: unreachable: ; CHECK-NEXT: unreachable ; CHECK: case0: -; CHECK-NEXT: br label [[CASE012]] +; CHECK-NEXT: br label [[CASE0123456]] ; CHECK: case1: -; CHECK-NEXT: br label [[CASE012]] +; CHECK-NEXT: br label [[CASE0123456]] ; CHECK: case012: -; CHECK-NEXT: [[PHI123:%.*]] = phi i8 [ 3, [[START:%.*]] ], [ 2, [[CASE1]] ], [ 1, [[CASE0]] ] ; CHECK-NEXT: br label [[CASE0123456]] ; CHECK: case3: -; CHECK-NEXT: br label [[CASE345]] +; CHECK-NEXT: br label [[CASE0123456]] ; CHECK: case4: -; CHECK-NEXT: br label [[CASE345]] +; CHECK-NEXT: br label [[CASE0123456]] ; CHECK: case345: -; CHECK-NEXT: [[PHI456:%.*]] = phi i8 [ 6, [[START]] ], [ 5, [[CASE4]] ], [ 4, [[CASE3]] ] ; CHECK-NEXT: br label [[CASE0123456]] ; CHECK: case0123456: -; CHECK-NEXT: [[PHI1234567:%.*]] = phi i8 [ 7, [[START]] ], [ [[PHI456]], [[CASE345]] ], [ [[PHI123]], [[CASE012]] ] +; CHECK-NEXT: [[PHI1234567:%.*]] = phi i8 [ 7, [[START:%.*]] ], [ 2, [[CASE1]] ], [ 1, [[CASE0]] ], [ 3, [[CASE012]] ], [ 5, [[CASE4]] ], [ 4, [[CASE3]] ], [ 6, [[CASE345]] ] ; CHECK-NEXT: ret i8 [[PHI1234567]] ; start: Index: llvm/test/Transforms/SimplifyCFG/multiple-phis.ll =================================================================== --- llvm/test/Transforms/SimplifyCFG/multiple-phis.ll +++ llvm/test/Transforms/SimplifyCFG/multiple-phis.ll @@ -63,17 +63,10 @@ define i32 @merge0(i1 %c1, i1 %c2, i1 %c3) { ; CHECK-LABEL: define i32 @merge0 ; CHECK-SAME: (i1 [[C1:%.*]], i1 [[C2:%.*]], i1 [[C3:%.*]]) { -; CHECK-NEXT: br i1 [[C1]], label [[IF1:%.*]], label [[ELSE1:%.*]] -; CHECK: if1: +; CHECK-NEXT: j2: ; CHECK-NEXT: [[DOT:%.*]] = select i1 [[C2]], i32 0, i32 1 -; CHECK-NEXT: br label [[J1:%.*]] -; CHECK: else1: -; CHECK-NEXT: br i1 [[C3]], label [[J1]], label [[J2:%.*]] -; CHECK: j1: -; CHECK-NEXT: [[PHI1:%.*]] = phi i32 [ 2, [[ELSE1]] ], [ [[DOT]], [[IF1]] ] -; CHECK-NEXT: br label [[J2]] -; CHECK: j2: -; CHECK-NEXT: [[PHI2:%.*]] = phi i32 [ [[PHI1]], [[J1]] ], [ 3, [[ELSE1]] ] +; CHECK-NEXT: [[SPEC_SELECT:%.*]] = select i1 [[C3]], i32 2, i32 3 +; CHECK-NEXT: [[PHI2:%.*]] = select i1 [[C1]], i32 [[DOT]], i32 [[SPEC_SELECT]] ; CHECK-NEXT: ret i32 [[PHI2]] ; br i1 %c1, label %if1, label %else1 @@ -103,7 +96,7 @@ ; CHECK-NEXT: entry: ; CHECK-NEXT: switch i8 [[ARG]], label [[UNREACHABLE:%.*]] [ ; CHECK-NEXT: i8 -123, label [[CASE0:%.*]] -; CHECK-NEXT: i8 66, label [[BB:%.*]] +; CHECK-NEXT: i8 66, label [[SUCC:%.*]] ; CHECK-NEXT: i8 123, label [[CASE2:%.*]] ; CHECK-NEXT: ] ; CHECK: unreachable: @@ -113,14 +106,12 @@ ; CHECK-NEXT: [[C2_NOT:%.*]] = xor i1 [[C2]], true ; CHECK-NEXT: [[BRMERGE:%.*]] = select i1 [[C1_NOT]], i1 true, i1 [[C2_NOT]] ; CHECK-NEXT: [[DOTMUX:%.*]] = select i1 [[C1_NOT]], i8 0, i8 3 -; CHECK-NEXT: br i1 [[BRMERGE]], label [[BB]], label [[SUCC:%.*]] +; CHECK-NEXT: [[SPEC_SELECT:%.*]] = select i1 [[BRMERGE]], i8 [[DOTMUX]], i8 4 +; CHECK-NEXT: br label [[SUCC]] ; CHECK: case2: -; CHECK-NEXT: br label [[BB]] -; CHECK: BB: -; CHECK-NEXT: [[PHI1:%.*]] = phi i8 [ [[DOTMUX]], [[CASE0]] ], [ 2, [[CASE2]] ], [ 1, [[ENTRY:%.*]] ] ; CHECK-NEXT: br label [[SUCC]] ; CHECK: Succ: -; CHECK-NEXT: [[PHI2:%.*]] = phi i8 [ [[PHI1]], [[BB]] ], [ 4, [[CASE0]] ] +; CHECK-NEXT: [[PHI2:%.*]] = phi i8 [ 2, [[CASE2]] ], [ 1, [[ENTRY:%.*]] ], [ [[SPEC_SELECT]], [[CASE0]] ] ; CHECK-NEXT: ret i8 [[PHI2]] ; entry: @@ -160,7 +151,7 @@ ; CHECK-NEXT: entry: ; CHECK-NEXT: switch i8 [[ARG]], label [[UNREACHABLE:%.*]] [ ; CHECK-NEXT: i8 -123, label [[CASE0:%.*]] -; CHECK-NEXT: i8 66, label [[BB:%.*]] +; CHECK-NEXT: i8 66, label [[SUCC:%.*]] ; CHECK-NEXT: i8 123, label [[CASE2:%.*]] ; CHECK-NEXT: ] ; CHECK: unreachable: @@ -171,14 +162,12 @@ ; CHECK-NEXT: [[C2_NOT:%.*]] = xor i1 [[C2]], true ; CHECK-NEXT: [[BRMERGE:%.*]] = select i1 [[C1_NOT]], i1 true, i1 [[C2_NOT]] ; CHECK-NEXT: [[DOTMUX:%.*]] = select i1 [[C1_NOT]], i8 0, i8 3 -; CHECK-NEXT: br i1 [[BRMERGE]], label [[BB]], label [[SUCC:%.*]] +; CHECK-NEXT: [[SPEC_SELECT:%.*]] = select i1 [[BRMERGE]], i8 [[DOTMUX]], i8 4 +; CHECK-NEXT: br label [[SUCC]] ; CHECK: case2: -; CHECK-NEXT: br label [[BB]] -; CHECK: BB: -; CHECK-NEXT: [[PHI1:%.*]] = phi i8 [ [[DOTMUX]], [[CASE0]] ], [ 2, [[CASE2]] ], [ 1, [[ENTRY:%.*]] ] ; CHECK-NEXT: br label [[SUCC]] ; CHECK: Succ: -; CHECK-NEXT: [[PHI2:%.*]] = phi i8 [ [[PHI1]], [[BB]] ], [ 4, [[CASE0]] ] +; CHECK-NEXT: [[PHI2:%.*]] = phi i8 [ 2, [[CASE2]] ], [ 1, [[ENTRY:%.*]] ], [ [[SPEC_SELECT]], [[CASE0]] ] ; CHECK-NEXT: ret i8 [[PHI2]] ; entry: @@ -220,7 +209,7 @@ ; CHECK-NEXT: switch i8 [[ARG]], label [[UNREACHABLE:%.*]] [ ; CHECK-NEXT: i8 -123, label [[CASE0:%.*]] ; CHECK-NEXT: i8 66, label [[CASE1:%.*]] -; CHECK-NEXT: i8 123, label [[BB:%.*]] +; CHECK-NEXT: i8 123, label [[SUCC:%.*]] ; CHECK-NEXT: ] ; CHECK: unreachable: ; CHECK-NEXT: unreachable @@ -230,15 +219,13 @@ ; CHECK-NEXT: [[C2_NOT:%.*]] = xor i1 [[C2]], true ; CHECK-NEXT: [[BRMERGE:%.*]] = select i1 [[C1_NOT]], i1 true, i1 [[C2_NOT]] ; CHECK-NEXT: [[DOTMUX:%.*]] = select i1 [[C1_NOT]], i8 0, i8 3 -; CHECK-NEXT: br i1 [[BRMERGE]], label [[BB]], label [[SUCC:%.*]] +; CHECK-NEXT: [[SPEC_SELECT:%.*]] = select i1 [[BRMERGE]], i8 [[DOTMUX]], i8 4 +; CHECK-NEXT: br label [[SUCC]] ; CHECK: case1: ; CHECK-NEXT: call void @dummy() -; CHECK-NEXT: br label [[BB]] -; CHECK: BB: -; CHECK-NEXT: [[PHI1:%.*]] = phi i8 [ [[DOTMUX]], [[CASE0]] ], [ 1, [[CASE1]] ], [ 2, [[ENTRY:%.*]] ] ; CHECK-NEXT: br label [[SUCC]] ; CHECK: Succ: -; CHECK-NEXT: [[PHI2:%.*]] = phi i8 [ [[PHI1]], [[BB]] ], [ 4, [[CASE0]] ] +; CHECK-NEXT: [[PHI2:%.*]] = phi i8 [ 1, [[CASE1]] ], [ 2, [[ENTRY:%.*]] ], [ [[SPEC_SELECT]], [[CASE0]] ] ; CHECK-NEXT: ret i8 [[PHI2]] ; entry: @@ -287,21 +274,19 @@ ; CHECK-NEXT: unreachable ; CHECK: case0: ; CHECK-NEXT: call void @dummy() -; CHECK-NEXT: br i1 [[C1]], label [[COMMONPRED:%.*]], label [[BB:%.*]] +; CHECK-NEXT: br i1 [[C1]], label [[COMMONPRED:%.*]], label [[SUCC:%.*]] ; CHECK: case1: ; CHECK-NEXT: call void @dummy() -; CHECK-NEXT: br label [[BB]] +; CHECK-NEXT: br label [[SUCC]] ; CHECK: case2: ; CHECK-NEXT: call void @dummy() -; CHECK-NEXT: br label [[BB]] +; CHECK-NEXT: br label [[SUCC]] ; CHECK: CommonPred: ; CHECK-NEXT: call void @dummy() -; CHECK-NEXT: br i1 [[C2]], label [[SUCC:%.*]], label [[BB]] -; CHECK: BB: -; CHECK-NEXT: [[PHI1:%.*]] = phi i8 [ 0, [[CASE0]] ], [ 1, [[CASE1]] ], [ 2, [[CASE2]] ], [ 3, [[COMMONPRED]] ] +; CHECK-NEXT: [[SPEC_SELECT:%.*]] = select i1 [[C2]], i8 4, i8 3 ; CHECK-NEXT: br label [[SUCC]] ; CHECK: Succ: -; CHECK-NEXT: [[PHI2:%.*]] = phi i8 [ [[PHI1]], [[BB]] ], [ 4, [[COMMONPRED]] ] +; CHECK-NEXT: [[PHI2:%.*]] = phi i8 [ 0, [[CASE0]] ], [ 1, [[CASE1]] ], [ 2, [[CASE2]] ], [ [[SPEC_SELECT]], [[COMMONPRED]] ] ; CHECK-NEXT: ret i8 [[PHI2]] ; entry: Index: llvm/test/Transforms/SimplifyCFG/switch-simplify-crash2.ll =================================================================== --- llvm/test/Transforms/SimplifyCFG/switch-simplify-crash2.ll +++ llvm/test/Transforms/SimplifyCFG/switch-simplify-crash2.ll @@ -6,6 +6,9 @@ ; CHECK-NEXT: entry: ; CHECK-NEXT: br label [[LOOP2:%.*]] ; CHECK: loop2: +; CHECK-NEXT: [[PHI2:%.*]] = phi i8 [ 0, [[ENTRY:%.*]] ], [ [[SPEC_SELECT:%.*]], [[LOOP2]] ] +; CHECK-NEXT: [[COND:%.*]] = icmp eq i8 [[PHI2]], 0 +; CHECK-NEXT: [[SPEC_SELECT]] = select i1 [[COND]], i8 0, i8 [[PHI2]] ; CHECK-NEXT: br label [[LOOP2]] ; entry: