[PATCH] D45377: [SampleFDO] Don't let inliner treat warm callsite with inline instance in the profile as cold

Dehao Chen via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 30 21:05:39 PDT 2018


On Mon, Apr 30, 2018 at 8:51 PM, Wei Mi via Phabricator <
reviews at reviews.llvm.org> wrote:

> wmi added inline comments.
>
>
> ================
> Comment at: lib/Transforms/IPO/SampleProfile.cpp:368
> +  uint64_t CallsiteTotalSamples = CallsiteFS->getTotalSamples();
> +  if (PSI && PSI->isHotCount(CallsiteTotalSamples))
> +    return true;
> ----------------
> danielcdh wrote:
> > In what situations will PSI be nullptr? If not, then please assert it
> instead.
> >
> > Also, I think this will overwrite the later (PercentSamples >=
> SampleProfileHotThreshold) heuristic, and we should remove that flag.
> PSI will not be nullptr. Will add an assertion.
>
> It is possible that for a callsite its CallsiteTotalSamples is less than
> hot cutoff threshold but still have a PententSamples larger than
> SampleProfileHotThreshold. My original plan is if a callsite is inlined
> currently, the new heuristic will still keep it.
>
> But I check where SampleProfileHotThreshold is used and find it is also
> used to populate the InlinedGUIDs set. To make that simple and consistent,
> like you suggest, I may remove SampleProfileHotThreshold and related
> heuristic.
>

I think you will also need to update that to make it consistent with the
early inline heuristic, otherwise the thinlto compile phase may not be able
to find the function to inline.

Dehao


>
>
> Repository:
>   rL LLVM
>
> https://reviews.llvm.org/D45377
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180430/b0d5dc4a/attachment.html>


More information about the llvm-commits mailing list