[llvm] [InstrProf] Adding utility weights to BalancedPartitioning (PR #72717)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 20 11:58:11 PST 2023
================
@@ -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());
----------------
spupyrev wrote:
That's a good suggestion but perhaps needs some experiments? In this diff I kept the behavior unchanged.
https://github.com/llvm/llvm-project/pull/72717
More information about the llvm-commits
mailing list