The call target count profile is directly derived from LBR branch->target data. This is more reliable than instruction frequency profiles that could be moved across basic block boundaries. This patches uses call target count profile to annotate call instructions.
Details
Details
Diff Detail
Diff Detail
Event Timeline
Comment Actions
OK, so instead of looking at the number of samples collected at the call site, it looks at the number of calls the target had. But what if the target is called disproportionately more from one call site than the other?
Like:
if (this_is_true_95_percent_of_the_time())
A();
else
A();
The example is ridiculous, I know, but wouldn't we end up inlining A() in both branches of the if()? Is that a code growth issue in general?
Comment Actions
No because we use lineno+discriminator to distinguish a callsite, so we can precisely locate both callsites to A and only inline the hot one.