mirror of
https://github.com/RPCS3/llvm.git
synced 2026-07-19 23:23:38 -04:00
Move accurate-sample-profile into the function attribute.
Summary: We need to have accurate-sample-profile in function attribute so that it works with LTO. Reviewers: davidxl, rsmith Reviewed By: davidxl Subscribers: sanjoy, mehdi_amini, javed.absar, llvm-commits, eraman Differential Revision: https://reviews.llvm.org/D37113 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311706 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -39,8 +39,8 @@ static cl::opt<int> ProfileSummaryCutoffCold(
|
||||
cl::desc("A count is cold if it is below the minimum count"
|
||||
" to reach this percentile of total counts."));
|
||||
|
||||
static cl::opt<bool> AccurateSampleProfile(
|
||||
"accurate-sample-profile", cl::Hidden, cl::init(false),
|
||||
static cl::opt<bool> ProfileSampleAccurate(
|
||||
"profile-sample-accurate", cl::Hidden, cl::init(false),
|
||||
cl::desc("If the sample profile is accurate, we will mark all un-sampled "
|
||||
"callsite as cold. Otherwise, treat un-sampled callsites as if "
|
||||
"we have no profile."));
|
||||
@@ -231,7 +231,8 @@ bool ProfileSummaryInfo::isColdCallSite(const CallSite &CS,
|
||||
// If there is no profile for the caller, and we know the profile is
|
||||
// accurate, we consider the callsite as cold.
|
||||
return (hasSampleProfile() &&
|
||||
(CS.getCaller()->getEntryCount() || AccurateSampleProfile));
|
||||
(CS.getCaller()->getEntryCount() || ProfileSampleAccurate ||
|
||||
CS.getCaller()->hasFnAttribute("profile-sample-accurate")));
|
||||
}
|
||||
|
||||
INITIALIZE_PASS(ProfileSummaryInfoWrapperPass, "profile-summary-info",
|
||||
|
||||
Reference in New Issue
Block a user