Zero-sized functions should be cost-free in term of size budget, so they should be considered during inlining even if we run out of size budget.
This appears to give 0.5% win for one of our internal services.
Differential D153820
[CSSPGO][Preinliner] Always inline zero-sized functions. Authored by hoy on Jun 26 2023, 3:42 PM.
Details Zero-sized functions should be cost-free in term of size budget, so they should be considered during inlining even if we run out of size budget. This appears to give 0.5% win for one of our internal services.
Diff Detail
Event TimelineComment Actions Can this be achieved by simply tweaking ProfiledCandidateComparer so zero SizeCost candidate always comes before non-zero ones? Comment Actions lgtm, thanks.
| ||||||
nit: merge the two ifs into a single line?
if ((LHS.SizeCost == 0 || RHS.SizeCost == 0) && LHS.SizeCost != RHS.SizeCost) return return RHS.SizeCost == 0;