[PATCH] D38478: Use the first instruction's count to estimate the funciton's entry frequency.
Dehao Chen via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 3 12:48:11 PDT 2017
danielcdh marked an inline comment as done.
danielcdh added inline comments.
================
Comment at: include/llvm/ProfileData/SampleProf.h:304
+ /// gives more accurate profile data and is preferred for standalong symbols.
uint64_t getHeadSamples() const { return TotalHeadSamples; }
----------------
tejohnson wrote:
> Should this be used somewhere in this change since it is preferred?
This was used by standalone symbols before this change. The 2 newly added use of getEntryCount was used in this patch for inlined functions.
================
Comment at: include/llvm/ProfileData/SampleProf.h:311
+ (CallsiteSamples.empty() ||
+ BodySamples.begin()->first < CallsiteSamples.begin()->first))
+ return BodySamples.begin()->second.getSamples();
----------------
tejohnson wrote:
> What is this line checking?
Added comment to make it clear.
================
Comment at: include/llvm/ProfileData/SampleProf.h:316
+ for (const auto &N_FS : CallsiteSamples.begin()->second)
+ T += N_FS.second.getEntrySamples();
+ return T;
----------------
tejohnson wrote:
> What do these samples correspond to?
Updated comment to make it clear.
https://reviews.llvm.org/D38478
More information about the llvm-commits
mailing list