This is an archive of the discontinued LLVM Phabricator instance.

Adjust the hotness threshold from 99.9% to 99%.
ClosedPublic

Authored by danielcdh on Aug 4 2017, 8:41 AM.

Details

Summary

We originally set the hotness threshold as 99.9% to be consistent with gcc FDO. But because the inline heuristic is different between 2 compilers: llvm uses bottom-up algorithm while gcc uses priority based. The LLVM algorithm tends to inline too much early that prevents hot callsites from further inlined into its caller. Due to this restriction, we think it is reasonable to lower the hotness threshold to give priority to those that are really hot. Our experiments show that this change would improve performance on large applications. Note that the inline heuristic has great room for further tuning. Once the inline heuristics are refined, we could adjust this threshold to allow inlining for less hot callsites.

Event Timeline

danielcdh created this revision.Aug 4 2017, 8:41 AM
This revision is now accepted and ready to land.Aug 4 2017, 8:44 AM
danielcdh closed this revision.Aug 4 2017, 9:21 AM
davidxl edited edge metadata.Aug 4 2017, 10:14 AM

Bottom up ininling can also create lots of cold inline instances. Other than the effect of blocking hotter callers from being inlined, current Machine Block Layout also has problems forming long hot traces leaving holes in code layout.

I wonder if another way to fix this is better: 1) compute 99.9% working set size 2) if it is too large compared with the working set threshold, drop the hot cutoff.