diff options
author | Eric Liu <ioeric@google.com> | 2016-04-18 15:31:11 +0000 |
---|---|---|
committer | Eric Liu <ioeric@google.com> | 2016-04-18 15:31:11 +0000 |
commit | d09f15ea6f17e51ec2ec59b8c3b0e5ba52dd8358 (patch) | |
tree | 84ea417235fc849a0b45704fb518b0f9f7582ba5 /llvm/lib/ProfileData/ProfileSummary.cpp | |
parent | 4f2aa5756989c672d111b683eb095275e14ed56b (diff) | |
download | bcm5719-llvm-d09f15ea6f17e51ec2ec59b8c3b0e5ba52dd8358.tar.gz bcm5719-llvm-d09f15ea6f17e51ec2ec59b8c3b0e5ba52dd8358.zip |
Revert "Replace the use of MaxFunctionCount module flag"
This reverts commit r266477.
This commit introduces cyclic dependency. This commit has "Analysis" depend on "ProfileData",
while "ProfileData" depends on "Object", which depends on "BitCode", which
depends on "Analysis".
llvm-svn: 266619
Diffstat (limited to 'llvm/lib/ProfileData/ProfileSummary.cpp')
-rw-r--r-- | llvm/lib/ProfileData/ProfileSummary.cpp | 44 |
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; -} |