Page MenuHomePhabricator

Slightly increase LastCallToStaticBonus for cold callsites
Needs ReviewPublic

Authored by kongyi on Jun 7 2019, 4:12 PM.

Details

Summary

r309441 changed LastCallToStaticBonus inling bonus to 0 for cold callsites, so that the caller has better chance of getting inlined. This makes sense for large callsites but for small callsites not inlining can actually make caller larger.

Slightly increased the bonus from 0 to 50. This resulted in LLVM test-suite mean text size reduced by 0.02%, with no significant performance change observed.

Diff Detail

Repository
rL LLVM

Event Timeline

kongyi created this revision.Jun 7 2019, 4:12 PM

The only case where not inlining results in a bigger caller size is when the cost of inlining a callsite is negative. But such callsites always get inlined as the threshold is always positive. Why do you require an additional bonus to get those callsites inlined?

Btw, please, take a look at this review: https://reviews.llvm.org/D60740
I have not found time to integrate it yet, but it slightly changes the approach on handling this bonus
(main idea is to apply it to threshold, like majority of other bonues, instead of applying it to cost).

It might change your approach here...