summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/ProfileSummaryInfo.cpp
diff options
context:
space:
mode:
authorEaswaran Raman <eraman@google.com>2017-05-16 20:14:39 +0000
committerEaswaran Raman <eraman@google.com>2017-05-16 20:14:39 +0000
commitdadc0f11ad99841f6b205bf798497ee32adf7ec6 (patch)
tree3a8f312d50f9b57f72c90332236a70aa3e491a8a /llvm/lib/Analysis/ProfileSummaryInfo.cpp
parent6b6ce6350fbe16a260d58e6fcaf6dffc3c053f8a (diff)
downloadbcm5719-llvm-dadc0f11ad99841f6b205bf798497ee32adf7ec6.tar.gz
bcm5719-llvm-dadc0f11ad99841f6b205bf798497ee32adf7ec6.zip
Add hasProfileSummary and has{Sample|Instrumentation}Profile methods
ProfileSummaryInfo already checks whether the module has sample profile in determining profile counts. This will also be useful in inliner to clean up threshold updates. llvm-svn: 303204
Diffstat (limited to 'llvm/lib/Analysis/ProfileSummaryInfo.cpp')
-rw-r--r--llvm/lib/Analysis/ProfileSummaryInfo.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/ProfileSummaryInfo.cpp b/llvm/lib/Analysis/ProfileSummaryInfo.cpp
index 502f4205b68..12b86daa602 100644
--- a/llvm/lib/Analysis/ProfileSummaryInfo.cpp
+++ b/llvm/lib/Analysis/ProfileSummaryInfo.cpp
@@ -75,7 +75,7 @@ ProfileSummaryInfo::getProfileCount(const Instruction *Inst,
return None;
assert((isa<CallInst>(Inst) || isa<InvokeInst>(Inst)) &&
"We can only get profile count for call/invoke instruction.");
- if (computeSummary() && Summary->getKind() == ProfileSummary::PSK_Sample) {
+ if (hasSampleProfile()) {
// In sample PGO mode, check if there is a profile metadata on the
// instruction. If it is present, determine hotness solely based on that,
// since the sampled entry count may not be accurate.
OpenPOWER on IntegriCloud