Skip to content

Commit b4ab53c

Browse files
[Target] Use llvm::max_element (NFC) (#137926)
1 parent aea2f6f commit b4ab53c

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

llvm/lib/Target/Mips/MipsDelaySlotFiller.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -877,9 +877,9 @@ MipsDelaySlotFiller::selectSuccBB(MachineBasicBlock &B) const {
877877

878878
// Select the successor with the larget edge weight.
879879
auto &Prob = getAnalysis<MachineBranchProbabilityInfoWrapperPass>().getMBPI();
880-
MachineBasicBlock *S = *std::max_element(
881-
B.succ_begin(), B.succ_end(),
882-
[&](const MachineBasicBlock *Dst0, const MachineBasicBlock *Dst1) {
880+
MachineBasicBlock *S =
881+
*llvm::max_element(B.successors(), [&](const MachineBasicBlock *Dst0,
882+
const MachineBasicBlock *Dst1) {
883883
return Prob.getEdgeProbability(&B, Dst0) <
884884
Prob.getEdgeProbability(&B, Dst1);
885885
});

llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2542,8 +2542,7 @@ SDValue WebAssemblyTargetLowering::LowerBUILD_VECTOR(SDValue Op,
25422542
};
25432543

25442544
auto GetMostCommon = [](auto &Counts) {
2545-
auto CommonIt =
2546-
std::max_element(Counts.begin(), Counts.end(), llvm::less_second());
2545+
auto CommonIt = llvm::max_element(Counts, llvm::less_second());
25472546
assert(CommonIt != Counts.end() && "Unexpected all-undef build_vector");
25482547
return *CommonIt;
25492548
};

0 commit comments

Comments
 (0)