[PATCH] D22261: [InlineCost] Set minsize inline threshold to 0

Mehdi AMINI via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 28 09:44:08 PDT 2016


mehdi_amini added a comment.

In https://reviews.llvm.org/D22261#499087, @jmolloy wrote:

> Hi Chandler,
>
> We discussed this on IRC and you were suspicious of my numbers. I was too, so I did more re-running. It turns out that CMake was appending -O3 to all of my builds, so the numbers I got were completely worthless.
>
> Having done a *lot* more testing, I can confirm that purely setting the threshold to zero causes significant code size regressions. I've looked at these and 99% of them are in C++ code. It turns out that although we were giving a bonus for inlining the last call to an internal function, we weren't doing the same for linkonce_odr functions which is what C++ templates become. This is what was causing our bloat.


This makes sense: linkonce_odr are not internal, they are not much different than a regular global.

> Ideally, we'd teach the inliner to much more accurately determine the overall expansion of a tree of thunks and tiny template expansions. However simply giving a bonus bump to linkonce_odr functions in the same way as internal functions appears to do the trick quite well.


This is fairly arbitrary.


https://reviews.llvm.org/D22261





More information about the llvm-commits mailing list