SamplePGO - Fix default threshold for hot callsites.
authorDiego Novillo <dnovillo@google.com>
Fri, 27 Nov 2015 23:14:49 +0000 (23:14 +0000)
committerDiego Novillo <dnovillo@google.com>
Fri, 27 Nov 2015 23:14:49 +0000 (23:14 +0000)
commit2badfee8a86a6b91d29138c3d9ca15e88db293c4
tree0a99adcd4f6c87639c0336c09ec3444e28d72f7a
parent13318e52ce3357005f263d3d3a82ce40012505ec
SamplePGO - Fix default threshold for hot callsites.

Based on testing of internal benchmarks, I'm lowering this threshold to
a value of 0.1%.  This means that SamplePGO will respect 99.9% of the
original inline decisions when following a profile.

The performance difference is noticeable in some tests. With the
previous threshold, the speedups over baseline -O2 was about 0.63%. With
the new default, the speedups are around 3% on average.

The point of this threshold is not to do more aggressive inlining. When
an inlined callsite crosses this threshold, SamplePGO will redo the
inline decision so that it can better apply the input profile.

By respecting most original inline decisions, we can apply more of the
input profile because the shape of the code follows the profile more
closely.

In the next series, I'll be looking at adding some inline hints for the
cold callsites and for toplevel functions that are hot/cold as well.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254211 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/IPO/SampleProfile.cpp