[PATCH] D112489: [CSSPGO] Trim cold profiles with the CS preinliner.

Lei Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 27 17:23:31 PDT 2021


wlei added inline comments.


================
Comment at: llvm/lib/ProfileData/SampleProf.cpp:335
+    uint32_t ColdContextFrameLength, bool TrimBaseProfileOnly) {
   if (!TrimColdContext && !MergeColdContext)
     return;
----------------
what if `TrimBaseProfileOnly` is true but those two are false, shall we skip the trim?

maybe change to `if (!TrimColdContext && !MergeColdContext && !TrimBaseProfileOnly)`


================
Comment at: llvm/lib/ProfileData/SampleProf.cpp:357
   for (const auto &I : ColdProfiles) {
     if (MergeColdContext) {
       auto MergedContext = I.second->getContext().getContextFrames();
----------------
`if(MergeColdContext && !TrimBaseProfileOnly)`

So that `MergedProfileMap` will be empty for `TrimBaseProfileOnly`


================
Comment at: llvm/lib/ProfileData/SampleProf.cpp:367
   }
 
   // Move the merged profiles into ProfileMap;
----------------
Then we can add an assertion:  TrimBaseProfileOnly && MergedProfileMap.empty()


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D112489



More information about the llvm-commits mailing list