diff options
| author | Dehao Chen <dehao@google.com> | 2016-10-10 21:47:28 +0000 |
|---|---|---|
| committer | Dehao Chen <dehao@google.com> | 2016-10-10 21:47:28 +0000 |
| commit | 84287abf431fe40b6b689a5a725a536d964c4dc2 (patch) | |
| tree | 895219186535f380490828ff6bb6f83abd697474 /llvm/lib/Analysis | |
| parent | 4bf466bd0953b9cbfa7c31a6fad80c2abf8e5543 (diff) | |
| download | bcm5719-llvm-84287abf431fe40b6b689a5a725a536d964c4dc2.tar.gz bcm5719-llvm-84287abf431fe40b6b689a5a725a536d964c4dc2.zip | |
Rename isHotFunction/isColdFunction to isFunctionEntryHot/isFunctionEntryCold. (NFC)
This is in preparation for https://reviews.llvm.org/D25048
llvm-svn: 283805
Diffstat (limited to 'llvm/lib/Analysis')
| -rw-r--r-- | llvm/lib/Analysis/InlineCost.cpp | 4 | ||||
| -rw-r--r-- | llvm/lib/Analysis/ProfileSummaryInfo.cpp | 22 |
2 files changed, 12 insertions, 14 deletions
diff --git a/llvm/lib/Analysis/InlineCost.cpp b/llvm/lib/Analysis/InlineCost.cpp index a9d628dafbe..d820069e6ce 100644 --- a/llvm/lib/Analysis/InlineCost.cpp +++ b/llvm/lib/Analysis/InlineCost.cpp @@ -647,14 +647,14 @@ void CallAnalyzer::updateThreshold(CallSite CS, Function &Callee) { // when it would increase the threshold and the caller does not need to // minimize its size. bool InlineHint = Callee.hasFnAttribute(Attribute::InlineHint) || - PSI->isHotFunction(&Callee); + PSI->isFunctionEntryHot(&Callee); if (InlineHint && !Caller->optForMinSize()) Threshold = MaxIfValid(Threshold, Params.HintThreshold); if (HotCallsite && !Caller->optForMinSize()) Threshold = MaxIfValid(Threshold, Params.HotCallSiteThreshold); - bool ColdCallee = PSI->isColdFunction(&Callee); + bool ColdCallee = PSI->isFunctionEntryCold(&Callee); // For cold callees, use the ColdThreshold knob if it is available and reduces // the threshold. if (ColdCallee) diff --git a/llvm/lib/Analysis/ProfileSummaryInfo.cpp b/llvm/lib/Analysis/ProfileSummaryInfo.cpp index 5285b7fb9d0..289c1b21069 100644 --- a/llvm/lib/Analysis/ProfileSummaryInfo.cpp +++ b/llvm/lib/Analysis/ProfileSummaryInfo.cpp @@ -63,10 +63,10 @@ void ProfileSummaryInfo::computeSummary() { Summary.reset(ProfileSummary::getFromMD(SummaryMD)); } -/// Returns true if the function is a hot function. If it returns false, it -/// either means it is not hot or it is unknown whether F is hot or not (for +/// Returns true if the function's entry is hot. If it returns false, it +/// either means it is not hot or it is unknown whether it is hot or not (for /// example, no profile data is available). -bool ProfileSummaryInfo::isHotFunction(const Function *F) { +bool ProfileSummaryInfo::isFunctionEntryHot(const Function *F) { computeSummary(); if (!F || !Summary) return false; @@ -79,10 +79,10 @@ bool ProfileSummaryInfo::isHotFunction(const Function *F) { (uint64_t)(0.3 * (double)Summary->getMaxFunctionCount())); } -/// Returns true if the function is a cold function. If it returns false, it -/// either means it is not cold or it is unknown whether F is cold or not (for +/// Returns true if the function's entry is a cold. If it returns false, it +/// either means it is not cold or it is unknown whether it is cold or not (for /// example, no profile data is available). -bool ProfileSummaryInfo::isColdFunction(const Function *F) { +bool ProfileSummaryInfo::isFunctionEntryCold(const Function *F) { computeSummary(); if (!F) return false; @@ -149,8 +149,6 @@ ProfileSummaryInfo ProfileSummaryAnalysis::run(Module &M, return ProfileSummaryInfo(M); } -// FIXME: This only tests isHotFunction and isColdFunction and not the -// isHotCount and isColdCount calls. PreservedAnalyses ProfileSummaryPrinterPass::run(Module &M, ModuleAnalysisManager &AM) { ProfileSummaryInfo &PSI = AM.getResult<ProfileSummaryAnalysis>(M); @@ -158,10 +156,10 @@ PreservedAnalyses ProfileSummaryPrinterPass::run(Module &M, OS << "Functions in " << M.getName() << " with hot/cold annotations: \n"; for (auto &F : M) { OS << F.getName(); - if (PSI.isHotFunction(&F)) - OS << " :hot "; - else if (PSI.isColdFunction(&F)) - OS << " :cold "; + if (PSI.isFunctionEntryHot(&F)) + OS << " :hot entry "; + else if (PSI.isFunctionEntryCold(&F)) + OS << " :cold entry "; OS << "\n"; } return PreservedAnalyses::all(); |

