[all-commits] [llvm/llvm-project] 5f2d73: [CSSPGO] Fix incorrect prorating indirect call di...
Hongtao Yu via All-commits
all-commits at lists.llvm.org
Fri Apr 23 11:09:45 PDT 2021
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 5f2d7300733b9eb6f4c60be89a16628f63c74443
https://github.com/llvm/llvm-project/commit/5f2d7300733b9eb6f4c60be89a16628f63c74443
Author: Hongtao Yu <hoy at fb.com>
Date: 2021-04-23 (Fri, 23 Apr 2021)
Changed paths:
M llvm/lib/Transforms/IPO/SampleProfile.cpp
M llvm/test/Transforms/SampleProfile/pseudo-probe-icp-factor.ll
Log Message:
-----------
[CSSPGO] Fix incorrect prorating indirect call distribution factor that leads to target count loss.
Pseudo probe distribution factor is used to scale down profile samples to avoid misleading the counts inference due to the usage of "maximum" in `getBlockWeight`. For callsites, the scaling down can come from code duplication prior to the sample profile loader (prelink or postlink), or due to the indirect call promotion in sample loader inliner. This patch fixes an issue in sample loader ICP where the leftover indirect callsite scaling down causes the loss of non-promoted call target samples unexpectedly. While the scaling down is to favor BFI/BPI with accurate an callsite count, it doesn't fit in the current distribution factor that represents code duplication changes. Ideally, we would need two factors, one is for code duplication, the other is for ICP. However this seems over complicated. I'm going to trade one usage (callsite counts) for the other (call target counts).
Seeing perf win on one benchmark (mcf) of SPEC2017 with others unchanged.
Reviewed By: wenlei
Differential Revision: https://reviews.llvm.org/D100993
More information about the All-commits
mailing list