diff --git a/llvm/lib/Target/Mips/MipsDelaySlotFiller.cpp b/llvm/lib/Target/Mips/MipsDelaySlotFiller.cpp index 7592634117dc1..9d07512b7d8a6 100644 --- a/llvm/lib/Target/Mips/MipsDelaySlotFiller.cpp +++ b/llvm/lib/Target/Mips/MipsDelaySlotFiller.cpp @@ -877,9 +877,9 @@ MipsDelaySlotFiller::selectSuccBB(MachineBasicBlock &B) const { // Select the successor with the larget edge weight. auto &Prob = getAnalysis().getMBPI(); - MachineBasicBlock *S = *std::max_element( - B.succ_begin(), B.succ_end(), - [&](const MachineBasicBlock *Dst0, const MachineBasicBlock *Dst1) { + MachineBasicBlock *S = + *llvm::max_element(B.successors(), [&](const MachineBasicBlock *Dst0, + const MachineBasicBlock *Dst1) { return Prob.getEdgeProbability(&B, Dst0) < Prob.getEdgeProbability(&B, Dst1); }); diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp index 794db887bd073..aac68b32da13a 100644 --- a/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp +++ b/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp @@ -2542,8 +2542,7 @@ SDValue WebAssemblyTargetLowering::LowerBUILD_VECTOR(SDValue Op, }; auto GetMostCommon = [](auto &Counts) { - auto CommonIt = - std::max_element(Counts.begin(), Counts.end(), llvm::less_second()); + auto CommonIt = llvm::max_element(Counts, llvm::less_second()); assert(CommonIt != Counts.end() && "Unexpected all-undef build_vector"); return *CommonIt; };