]> granicus.if.org Git - llvm/commit
[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)
commit584a08b94de8a29f281c9fb2c89c74e6536f60a4
treef403077204eb053d1968995953a6dca65d8aaf85
parentffd5316983af6ab5e2654a0e6d47d9504eb0940f
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372189 91177308-0d34-0410-b5e6-96231b3b80d8
lib/ProfileData/InstrProfReader.cpp
lib/Transforms/Instrumentation/PGOInstrumentation.cpp
test/Transforms/PGOProfile/Inputs/func_entry.proftext
test/Transforms/PGOProfile/func_entry.ll