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

Teresa Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 10 09:41:15 PDT 2017


tejohnson added inline comments.


================
Comment at: lib/Transforms/IPO/SampleProfile.cpp:1268
+          findIndirectCallFunctionSamples(I, Sum);
           annotateValueSite(*I.getParent()->getParent()->getParent(), I,
                             SortedCallTargets, Sum, IPVK_IndirectCallTarget,
----------------
danielcdh wrote:
> 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.
The reason I ask is that this is different than what is done by the main ICP pass. E.g. see ICallPromotionFunc::processFunction and ICallPromotionFunc::tryToPromote, which update the total count before re-generating a new VP annotation. It also makes this patch have a larger effect than what is described in the summary. Suggest splitting this change out and evaluating separately.


https://reviews.llvm.org/D38478





More information about the llvm-commits mailing list