summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Analysis/InlineCost.cpp6
-rw-r--r--llvm/lib/ProfileData/ProfileSummary.cpp44
2 files changed, 2 insertions, 48 deletions
diff --git a/llvm/lib/Analysis/InlineCost.cpp b/llvm/lib/Analysis/InlineCost.cpp
index bf93677302a..aa46b68d8c3 100644
--- a/llvm/lib/Analysis/InlineCost.cpp
+++ b/llvm/lib/Analysis/InlineCost.cpp
@@ -30,7 +30,6 @@
#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"
@@ -627,11 +626,10 @@ 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;
- ProfileSummary *PS = ProfileSummary::getProfileSummary(Callee.getParent());
- if (Callee.getEntryCount() && PS) {
+ if (Callee.getEntryCount() && Callee.getParent()->getMaximumFunctionCount()) {
HasPGOCounts = true;
FunctionCount = Callee.getEntryCount().getValue();
- MaxFunctionCount = PS->getMaxFunctionCount();
+ MaxFunctionCount = Callee.getParent()->getMaximumFunctionCount().getValue();
}
// Listen to the inlinehint attribute or profile based hotness information
diff --git a/llvm/lib/ProfileData/ProfileSummary.cpp b/llvm/lib/ProfileData/ProfileSummary.cpp
index 50aa95829b4..33c1479e19c 100644
--- a/llvm/lib/ProfileData/ProfileSummary.cpp
+++ b/llvm/lib/ProfileData/ProfileSummary.cpp
@@ -15,7 +15,6 @@
#include "llvm/IR/Constants.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/Metadata.h"
-#include "llvm/IR/Module.h"
#include "llvm/IR/Type.h"
#include "llvm/ProfileData/InstrProf.h"
#include "llvm/ProfileData/ProfileCommon.h"
@@ -33,10 +32,6 @@ const std::vector<uint32_t> ProfileSummary::DefaultCutoffs(
900000, 950000, 990000, 999000, 999900, 999990, 999999});
const char *ProfileSummary::KindStr[2] = {"InstrProf", "SampleProfile"};
-ManagedStatic<std::pair<Module *, std::unique_ptr<ProfileSummary>>>
- ProfileSummary::CachedSummary;
-ManagedStatic<sys::SmartMutex<true>> ProfileSummary::CacheMutex;
-
void InstrProfSummary::addRecord(const InstrProfRecord &R) {
addEntryCount(R.Counts[0]);
for (size_t I = 1, E = R.Counts.size(); I < E; ++I)
@@ -87,39 +82,6 @@ void ProfileSummary::computeDetailedSummary() {
}
}
-bool ProfileSummary::operator==(ProfileSummary &Other) {
- if (getKind() != Other.getKind())
- return false;
- if (TotalCount != Other.TotalCount)
- return false;
- if (MaxCount != Other.MaxCount)
- return false;
- if (MaxFunctionCount != Other.MaxFunctionCount)
- return false;
- if (NumFunctions != Other.NumFunctions)
- return false;
- if (NumCounts != Other.NumCounts)
- return false;
- std::vector<ProfileSummaryEntry> DS1 = getDetailedSummary();
- std::vector<ProfileSummaryEntry> DS2 = Other.getDetailedSummary();
- auto CompareSummaryEntry = [](ProfileSummaryEntry &E1,
- ProfileSummaryEntry &E2) {
- return E1.Cutoff == E2.Cutoff && E1.MinCount == E2.MinCount &&
- E1.NumCounts == E2.NumCounts;
- };
- if (!std::equal(DS1.begin(), DS1.end(), DS2.begin(), CompareSummaryEntry))
- return false;
- return true;
-}
-
-bool InstrProfSummary::operator==(ProfileSummary &Other) {
- InstrProfSummary *OtherIPS = dyn_cast<InstrProfSummary>(&Other);
- if (!OtherIPS)
- return false;
- return MaxInternalBlockCount == OtherIPS->MaxInternalBlockCount &&
- ProfileSummary::operator==(Other);
-}
-
// Returns true if the function is a hot function.
bool ProfileSummary::isFunctionHot(const Function *F) {
// FIXME: update when summary data is stored in module's metadata.
@@ -400,9 +362,3 @@ ProfileSummary *ProfileSummary::getFromMD(Metadata *MD) {
else
return nullptr;
}
-
-ProfileSummary *ProfileSummary::computeProfileSummary(Module *M) {
- if (Metadata *MD = M->getProfileSummary())
- return getFromMD(MD);
- return nullptr;
-}
OpenPOWER on IntegriCloud