[PATCH] D112042: [llvm-profgen] Skip duplication factor outside of body sample computation

Rong Xu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 19 14:03:09 PDT 2021


xur added a subscriber: wenlei.
xur added a comment.

Sorry. I missed that part.

The total count straight from create_llvm_prof is always garbage.
The reason for this is that create_llvm_prof does not disassemble the
instruction.  It just uses address range to accumulate the counters.
 I found this when I worked on FSAFDO. If I want to get good function total
counts, I always do another merge of the profile (profile_merger) -- this
way the entry count will be recomputed and it's the sum of the counter
inside.
I had some discussions with Wei about this. But we think the function's
total count is not really used in the compiler.
I did some experiments and did not find a performance difference with fixed
function total counts.

Our production build uses another pipeline (it has a disassembler) and does
not suffer this issue.

Overconting is unavoidable here since there is no basic block (all the
instructions with different offset will have a count).

-Rong


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D112042



More information about the llvm-commits mailing list