[llvm] [profdata] Use --hot-func-list to show all hot functions (PR #149428)

Mingming Liu via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 18 13:01:37 PDT 2025


================
@@ -2863,15 +2862,7 @@ static int showInstrProfile(ShowFormat SFormat, raw_fd_ostream &OS) {
   int NumVPKind = IPVK_Last - IPVK_First + 1;
   std::vector<ValueSitesStats> VPStats(NumVPKind);
 
-  auto MinCmp = [](const std::pair<std::string, uint64_t> &v1,
-                   const std::pair<std::string, uint64_t> &v2) {
-    return v1.second > v2.second;
-  };
-
-  std::priority_queue<std::pair<std::string, uint64_t>,
-                      std::vector<std::pair<std::string, uint64_t>>,
-                      decltype(MinCmp)>
-      HottestFuncs(MinCmp);
+  std::vector<std::pair<uint64_t, uint64_t>> NameRefAndMaxCount;
----------------
mingmingl-llvm wrote:

What do you think of using `std::vector<std::pair<StringRef, uint64>> NameRefAndMaxCount` here? This can saves the hashing / re-hashing work. 

https://github.com/llvm/llvm-project/pull/149428


More information about the llvm-commits mailing list