[PATCH] D38478: Use the first instruction's count to estimate the funciton's entry frequency.

Dehao Chen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 9 09:26:11 PDT 2017


danielcdh added inline comments.


================
Comment at: lib/Transforms/IPO/SampleProfile.cpp:1268
+          findIndirectCallFunctionSamples(I, Sum);
           annotateValueSite(*I.getParent()->getParent()->getParent(), I,
                             SortedCallTargets, Sum, IPVK_IndirectCallTarget,
----------------
tejohnson wrote:
> Is this annotated the value profile before or after promotion/inlining of the indirect calls recorded as inlined in the profile? If after, not sure why we want to include the counts of the promoted/inlined targets in Sum (which AFAICT is what will happen by computing Sum via findIndirectCallFunctionSamples).
It's after. The reason we need to have all promoted counts included in SUM is because we do not want to promote too many targets.  E.g. if an indirect call site has already been promoted to 3 targets that covers 99% of the case. The rest 1%, even if it's 100% to a 4th target. we do not want to promote it.


https://reviews.llvm.org/D38478





More information about the llvm-commits mailing list