[PATCH] D81981: [PGO] Supplement PGO profile with Sample profile

Wei Mi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 22 14:42:04 PDT 2020


wmi marked an inline comment as done.
wmi added inline comments.


================
Comment at: llvm/tools/llvm-profdata/llvm-profdata.cpp:400
+  InstrProfRecord *ProfRecord = IFE.ProfRecord;
+  if (!InstrEntryCount) {
+    // If the function is never executed in instrumentation profile,
----------------
davidxl wrote:
> handling this case (all zero case) in this way won't help much -- The branch Probablity pass will set all branch weights to 1 making all branch unbiased -- it is worse than using static heuristic based.
> 
> The right way I think is to remove their profile entries completely. I assume the compiler pass later will treat such functions as unknown and not put into .text.unlikely.
But I think for a large part of the functions missing in loadtest, they have all zero counter values, so it is better to have a way to handle them. 

Is it possible for PGO to handle the functions with only entry counter not being zero and with other counters all being zero in a special way -- for those functions, just set the entry count and skip the metadata setting inside of the function? So that those functions can use static profiling inside. 


Repository:
  rL LLVM

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

https://reviews.llvm.org/D81981





More information about the llvm-commits mailing list