[PATCH] D45377: [SampleFDO] Don't let inliner treat warm callsite with inline instance in the profile as cold
Wei Mi via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 30 20:51:03 PDT 2018
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.
Repository:
rL LLVM
https://reviews.llvm.org/D45377
More information about the llvm-commits
mailing list