[PATCH] D99370: [CSSPGO] Minor tweak for inline candidate priority tie breaker
Wenlei He via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 25 16:43:57 PDT 2021
wenlei added inline comments.
================
Comment at: llvm/lib/Transforms/IPO/SampleProfile.cpp:329
+ // Tie breaker using number of samples try to favor smaller functions first
+ if (LCS->getBodySamples().size() != RCS->getBodySamples().size())
+ return LCS->getBodySamples().size() > RCS->getBodySamples().size();
----------------
wenlei wrote:
> hoy wrote:
> > Would it make sense to compare callee function size instead?
> Called that out in the change description. :)
Actually let me expand on this. Currently we don't retrieve callee functions when collecting candidate, we retrieve callee function when evaluating inline decisions.
We could alternatively retrieve callee functions earlier, but then we could also just run inline cost on it earlier and use that as 1st tier breaker?
There're definitely ways to get to more accurate prioritization, but until we know it is actually helping visibly, I'm trying to keep it simple by making a local change to have a better tie breaker than using names.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D99370/new/
https://reviews.llvm.org/D99370
More information about the llvm-commits
mailing list