[llvm] [InstrProf] Adding utility weights to BalancedPartitioning (PR #72717)
Ellis Hoag via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 17 13:55:55 PST 2024
================
@@ -933,8 +933,15 @@ std::vector<BPFunctionNode> TemporalProfTraceTy::createBPFunctionNodes(
std::vector<BPFunctionNode> Nodes;
for (auto &Id : FunctionIds) {
auto &UNs = FuncGroups[Id];
- llvm::sort(UNs);
- UNs.erase(std::unique(UNs.begin(), UNs.end()), UNs.end());
+ llvm::sort(UNs.begin(), UNs.end(),
+ [](const UtilityNodeT &L, const UtilityNodeT &R) {
+ return L.id < R.id;
+ });
+ UNs.erase(std::unique(UNs.begin(), UNs.end(),
+ [](const UtilityNodeT &L, const UtilityNodeT &R) {
+ return L.id == R.id;
+ }),
+ UNs.end());
----------------
ellishg wrote:
Lets at least add a comment here so we don't forget.
https://github.com/llvm/llvm-project/pull/72717
More information about the llvm-commits
mailing list