summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
diff options
context:
space:
mode:
authorEaswaran Raman <eraman@google.com>2016-06-21 19:29:49 +0000
committerEaswaran Raman <eraman@google.com>2016-06-21 19:29:49 +0000
commit8bceb9d210cb0f6d7f7825357cf82f878d3622b2 (patch)
tree6799d48b7fda276a2269da1557c217f94521bb91 /llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
parentea2a5e689754fa5c603aa0d01b6658fbbaf9fe43 (diff)
downloadbcm5719-llvm-8bceb9d210cb0f6d7f7825357cf82f878d3622b2.tar.gz
bcm5719-llvm-8bceb9d210cb0f6d7f7825357cf82f878d3622b2.zip
Fix PR28219: Use profile summary from reader and not compute it
Differentiaal revision: http://reviews.llvm.org/D21546 llvm-svn: 273301
Diffstat (limited to 'llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp')
-rw-r--r--llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp b/llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
index 6168f9ef77d..27f32b3de56 100644
--- a/llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
+++ b/llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
@@ -879,7 +879,6 @@ static bool annotateAllFunctions(
std::vector<Function *> HotFunctions;
std::vector<Function *> ColdFunctions;
- InstrProfSummaryBuilder Builder(ProfileSummaryBuilder::DefaultCutoffs);
for (auto &F : M) {
if (F.isDeclaration())
continue;
@@ -891,15 +890,13 @@ static bool annotateAllFunctions(
Func.populateCounters();
Func.setBranchWeights();
Func.annotateIndirectCallSites();
- if (!Func.getProfileRecord().Counts.empty())
- Builder.addRecord(Func.getProfileRecord());
PGOUseFunc::FuncFreqAttr FreqAttr = Func.getFuncFreqAttr();
if (FreqAttr == PGOUseFunc::FFA_Cold)
ColdFunctions.push_back(&F);
else if (FreqAttr == PGOUseFunc::FFA_Hot)
HotFunctions.push_back(&F);
}
- M.setProfileSummary(Builder.getSummary()->getMD(M.getContext()));
+ M.setProfileSummary(PGOReader->getSummary().getMD(M.getContext()));
// Set function hotness attribute from the profile.
// We have to apply these attributes at the end because their presence
// can affect the BranchProbabilityInfo of any callers, resulting in an
OpenPOWER on IntegriCloud