[PGO] Change hardcoded thresholds for cold/inlinehint to use summary
authorTeresa Johnson <tejohnson@google.com>
Tue, 17 Sep 2019 23:12:13 +0000 (23:12 +0000)
committerTeresa Johnson <tejohnson@google.com>
Tue, 17 Sep 2019 23:12:13 +0000 (23:12 +0000)
commitfd2044f29993ea014898cf0a21a03b2a147e6340
tree8f459dae1474be97c333138baec13b62f6e65d82
parent241b02e762872173dcb5bd27ff9fe3eb7dce1db2
[PGO] Change hardcoded thresholds for cold/inlinehint to use summary

Summary:
The PGO counter reading will add cold and inlinehint (hot) attributes
to functions that are very cold or hot. This was using hardcoded
thresholds, instead of the profile summary cutoffs which are used in
other hot/cold detection and are more dynamic and adaptable. Switch
to using the summary-based cold/hot detection.

The hardcoded limits were causing some code that had a medium level of
hotness (per the summary) to be incorrectly marked with a cold
attribute, blocking inlining.

Reviewers: davidxl

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D67673

llvm-svn: 372189
llvm/lib/ProfileData/InstrProfReader.cpp
llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
llvm/test/Transforms/PGOProfile/Inputs/func_entry.proftext
llvm/test/Transforms/PGOProfile/func_entry.ll