[PATCH] D104131: [CSSPGO] Aggregation by the last K context frames for cold profiles

Wenlei He via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 11 10:38:01 PDT 2021


wenlei added a comment.

Thanks for the patch. I think this can be useful for tuning. However as we discussed, it'd be nice if the level of merging (number of frames to keep after merging) can be adaptive based on hotness. But to do that, the preinliner in llvm-profgen is the way to go.



================
Comment at: llvm/include/llvm/ProfileData/SampleProf.h:441
+    while (I >= 0 && K > 0) {
+      if (FullContext[I--] == '@')
+        K--;
----------------
We need to find ` @ ` instead of `@` as mangle name can contain `@`. And how about using `StringRef::rfind` ?


================
Comment at: llvm/lib/ProfileData/SampleProf.cpp:347
   // Remove the cold profile from ProfileMap and merge them into BaseProileMap
   StringMap<FunctionSamples> BaseProfileMap;
   for (const auto &I : ColdProfiles) {
----------------
Now rename this to MergedProfileMap?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D104131/new/

https://reviews.llvm.org/D104131



More information about the llvm-commits mailing list