diff options
| author | Dehao Chen <dehao@google.com> | 2017-08-24 21:37:04 +0000 |
|---|---|---|
| committer | Dehao Chen <dehao@google.com> | 2017-08-24 21:37:04 +0000 |
| commit | f0e27e63e74977527e6e86a0117a64fbf7326b3d (patch) | |
| tree | bc8f19a1cce40f041a9ffb1c5746a8ad125ea029 /llvm/lib | |
| parent | bc933768a61e780c2edc7dc17dc65b3d3200f1d4 (diff) | |
| download | bcm5719-llvm-f0e27e63e74977527e6e86a0117a64fbf7326b3d.tar.gz bcm5719-llvm-f0e27e63e74977527e6e86a0117a64fbf7326b3d.zip | |
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
llvm-svn: 311706
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Analysis/ProfileSummaryInfo.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/ProfileSummaryInfo.cpp b/llvm/lib/Analysis/ProfileSummaryInfo.cpp index 4bad196a91a..671744f93fb 100644 --- a/llvm/lib/Analysis/ProfileSummaryInfo.cpp +++ b/llvm/lib/Analysis/ProfileSummaryInfo.cpp @@ -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", |

