summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/InlineCost.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Analysis/InlineCost.cpp')
-rw-r--r--llvm/lib/Analysis/InlineCost.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/InlineCost.cpp b/llvm/lib/Analysis/InlineCost.cpp
index d3b2930d7ea..87dac729367 100644
--- a/llvm/lib/Analysis/InlineCost.cpp
+++ b/llvm/lib/Analysis/InlineCost.cpp
@@ -30,6 +30,7 @@
#include "llvm/IR/InstVisitor.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/Operator.h"
+#include "llvm/ProfileData/ProfileCommon.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
@@ -630,10 +631,11 @@ void CallAnalyzer::updateThreshold(CallSite CS, Function &Callee) {
// a well-tuned heuristic based on *callsite* hotness and not callee hotness.
uint64_t FunctionCount = 0, MaxFunctionCount = 0;
bool HasPGOCounts = false;
- if (Callee.getEntryCount() && Callee.getParent()->getMaximumFunctionCount()) {
+ ProfileSummary *PS = ProfileSummary::getProfileSummary(Callee.getParent());
+ if (Callee.getEntryCount() && PS) {
HasPGOCounts = true;
FunctionCount = Callee.getEntryCount().getValue();
- MaxFunctionCount = Callee.getParent()->getMaximumFunctionCount().getValue();
+ MaxFunctionCount = PS->getMaxFunctionCount();
}
// Listen to the inlinehint attribute or profile based hotness information
OpenPOWER on IntegriCloud