Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions clang/lib/Serialization/ASTWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3205,9 +3205,7 @@ void ASTWriter::WritePragmaDiagnosticMappings(const DiagnosticsEngine &Diag,
}

// Sort by diag::kind for deterministic output.
llvm::sort(Mappings, [](const auto &LHS, const auto &RHS) {
return LHS.first < RHS.first;
});
llvm::sort(Mappings, llvm::less_first());

for (const auto &I : Mappings) {
Record.push_back(I.first);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,9 +259,7 @@ static void canonicalizeDefines(PreprocessorOptions &PPOpts) {
++Index;
}

llvm::stable_sort(SimpleNames, [](const MacroOpt &A, const MacroOpt &B) {
return A.first < B.first;
});
llvm::stable_sort(SimpleNames, llvm::less_first());
// Keep the last instance of each macro name by going in reverse
auto NewEnd = std::unique(
SimpleNames.rbegin(), SimpleNames.rend(),
Expand Down
10 changes: 2 additions & 8 deletions llvm/lib/MC/MCPseudoProbe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,10 @@ void MCPseudoProbeInlineTree::emit(MCObjectStreamer *MCOS,
// Emit sorted descendant. InlineSite is unique for each pair, so there will
// be no ordering of Inlinee based on MCPseudoProbeInlineTree*
using InlineeType = std::pair<InlineSite, MCPseudoProbeInlineTree *>;
auto Comparer = [](const InlineeType &A, const InlineeType &B) {
return A.first < B.first;
};
std::vector<InlineeType> Inlinees;
for (const auto &Child : Children)
Inlinees.emplace_back(Child.first, Child.second.get());
std::sort(Inlinees.begin(), Inlinees.end(), Comparer);
llvm::sort(Inlinees, llvm::less_first());

for (const auto &Inlinee : Inlinees) {
// Emit probe index
Expand Down Expand Up @@ -230,13 +227,10 @@ void MCPseudoProbeSections::emit(MCObjectStreamer *MCOS) {
// Emit sorted descendant. InlineSite is unique for each pair, so there
// will be no ordering of Inlinee based on MCPseudoProbeInlineTree*
using InlineeType = std::pair<InlineSite, MCPseudoProbeInlineTree *>;
auto Comparer = [](const InlineeType &A, const InlineeType &B) {
return A.first < B.first;
};
std::vector<InlineeType> Inlinees;
for (const auto &Child : Root.getChildren())
Inlinees.emplace_back(Child.first, Child.second.get());
std::sort(Inlinees.begin(), Inlinees.end(), Comparer);
llvm::sort(Inlinees, llvm::less_first());

for (const auto &Inlinee : Inlinees) {
// Emit the group guarded by a sentinel probe.
Expand Down
5 changes: 1 addition & 4 deletions llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -597,10 +597,7 @@ class SIMachineFunctionInfo final : public AMDGPUMachineFunction,
const ReservedRegSet &getWWMReservedRegs() const { return WWMReservedRegs; }

ArrayRef<PrologEpilogSGPRSpill> getPrologEpilogSGPRSpills() const {
assert(
is_sorted(PrologEpilogSGPRSpills, [](const auto &LHS, const auto &RHS) {
return LHS.first < RHS.first;
}));
assert(is_sorted(PrologEpilogSGPRSpills, llvm::less_first()));
return PrologEpilogSGPRSpills;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -557,9 +557,7 @@ struct GenericOpScheduler : public OpRewritePattern<linalg::GenericOp> {
unsigned lvl = llvm::cast<AffineDimExpr>(expr).getPosition();
lvlSeq.push_back(std::make_pair(lvl, lvlSeq.size()));
}
std::sort(lvlSeq.begin(), lvlSeq.end(), [](auto &lhs, auto &rhs) -> bool {
return lhs.first < rhs.first;
});
llvm::sort(lvlSeq, llvm::less_first());
SmallVector<unsigned> perm =
llvm::to_vector(llvm::make_second_range(lvlSeq));
auto dimToLvl = AffineMap::getPermutationMap(perm, linalgOp.getContext());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,7 @@ void LoopEmitter::initialize(ValueRange ts, StringAttr loopTag, bool hasOutput,
for (Level l = 0; l < lvlRank; l++) {
std::vector<std::pair<LoopId, unsigned>> deps = dimGetter(tid, l);
// Sort the loop by order.
std::sort(deps.begin(), deps.end(),
[](auto &lhs, auto &rhs) { return lhs.first < rhs.first; });
llvm::sort(deps, llvm::less_first());

dependentLvlMap[tid][l] = std::move(deps);
unsigned depends = dependentLvlMap[tid][l].size();
Expand Down