diff options
author | Easwaran Raman <eraman@google.com> | 2016-05-10 22:03:23 +0000 |
---|---|---|
committer | Easwaran Raman <eraman@google.com> | 2016-05-10 22:03:23 +0000 |
commit | 7eccf4ee0e8eec5cd64bebdec80ca4b92ecc2ecb (patch) | |
tree | 7072de2ecffd763ab4393e6b8d6f67623ade5958 /llvm/lib/Analysis/InlineCost.cpp | |
parent | b7883912607c01bdd9458172323bc664d73d0584 (diff) | |
download | llvm-7eccf4ee0e8eec5cd64bebdec80ca4b92ecc2ecb.zip llvm-7eccf4ee0e8eec5cd64bebdec80ca4b92ecc2ecb.tar.gz llvm-7eccf4ee0e8eec5cd64bebdec80ca4b92ecc2ecb.tar.bz2 |
Reapply r266477 and r266488
llvm-svn: 269131
Diffstat (limited to 'llvm/lib/Analysis/InlineCost.cpp')
-rw-r--r-- | llvm/lib/Analysis/InlineCost.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/InlineCost.cpp b/llvm/lib/Analysis/InlineCost.cpp index d3b2930..87dac72 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 |