]> granicus.if.org Git - llvm/commit
Use the first instruction's count to estimate the funciton's entry frequency.
authorDehao Chen <dehao@google.com>
Tue, 10 Oct 2017 21:13:50 +0000 (21:13 +0000)
committerDehao Chen <dehao@google.com>
Tue, 10 Oct 2017 21:13:50 +0000 (21:13 +0000)
commitded3597f2c1234ea8df401b5d1fd5cf096e64108
tree083549059d1b8f419c482c091a97b1148a2cee2c
parentc6f64890a266c4512dc975b8585ab71534c59847
Use the first instruction's count to estimate the funciton's entry frequency.

Summary: In the current implementation, we only have accurate profile count for standalone symbols. For inlined functions, we do not have entry count data because it's not available in LBR. In this patch, we use the first instruction's frequency to estimiate the function's entry count, especially for inlined functions. This may be inaccurate due to debug info in optimized code. However, this is a better estimate than the static 80/20 estimation we have in the current implementation.

Reviewers: tejohnson, davidxl

Reviewed By: tejohnson

Subscribers: sanjoy, llvm-commits, aprantl

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315369 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/ProfileData/SampleProf.h
lib/Transforms/IPO/SampleProfile.cpp
test/Transforms/SampleProfile/indirect-call.ll