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

David Li via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 22 14:18:25 PDT 2020


davidxl added a comment.

If we don't need to handle all zero cases using scaling, we can remove the dependency on the always entry patch.



================
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,
----------------
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.


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