summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ProfileData
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/ProfileData')
-rw-r--r--llvm/lib/ProfileData/ProfileSummary.cpp44
1 files changed, 0 insertions, 44 deletions
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