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
5 changes: 2 additions & 3 deletions bolt/include/bolt/Core/BinaryBasicBlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,8 @@ class BinaryBasicBlock {
uint64_t MispredictedCount; /// number of branches mispredicted

bool operator<(const BinaryBranchInfo &Other) const {
return (Count < Other.Count) ||
(Count == Other.Count &&
MispredictedCount < Other.MispredictedCount);
return std::tie(Count, MispredictedCount) <
std::tie(Other.Count, Other.MispredictedCount);
}
};

Expand Down
4 changes: 1 addition & 3 deletions bolt/include/bolt/Passes/PAuthGadgetScanner.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,7 @@ struct MCInstInBFReference {
return BF == RHS.BF && Offset == RHS.Offset;
}
bool operator<(const MCInstInBFReference &RHS) const {
if (BF != RHS.BF)
return BF < RHS.BF;
return Offset < RHS.Offset;
return std::tie(BF, Offset) < std::tie(RHS.BF, RHS.Offset);
}
operator MCInst &() const {
assert(BF != nullptr);
Expand Down
5 changes: 2 additions & 3 deletions bolt/lib/Profile/YAMLProfileWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,9 +303,8 @@ YAMLProfileWriter::convert(const BinaryFunction &BF, bool UseDFS,
}
// Sort targets in a similar way to getBranchData, see Location::operator<
llvm::sort(CSTargets, [](const auto &RHS, const auto &LHS) {
if (RHS.first != LHS.first)
return RHS.first < LHS.first;
return RHS.second.Offset < LHS.second.Offset;
return std::tie(RHS.first, RHS.second.Offset) <
std::tie(LHS.first, LHS.second.Offset);
});
for (auto &KV : CSTargets)
YamlBB.CallSites.push_back(KV.second);
Expand Down
Loading