[CSSPGO] Use callsite sample counts to annotate indirect call sites.
authorHongtao Yu <hoy@fb.com>
Thu, 18 Feb 2021 20:44:57 +0000 (12:44 -0800)
committerHongtao Yu <hoy@fb.com>
Thu, 18 Feb 2021 22:52:34 +0000 (14:52 -0800)
commite87b1b1d4e789d2350a07873998c992c08152ee6
tree45a0cecacdb3fba0c64b1b04946b07d30584903e
parent27093f1a94e2bb95400dfc5407b581aacb401951
[CSSPGO] Use callsite sample counts to annotate indirect call sites.

With CSSPGO all indirect call targets are counted torwards the original indirect call site in the profile, including both inlined and non-inlined targets. Therefore no need to look for callee entry counts. This also fixes the issue where callee entry count doesn't match callsite count due to the nature of CS sampling.

I'm also cleaning up the orginal code that called `findIndirectCallFunctionSamples` just to compute the sum, the return value of which was disgarded.

Reviewed By: wmi, wenlei

Differential Revision: https://reviews.llvm.org/D96990
llvm/lib/Transforms/IPO/SampleProfile.cpp