summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorDehao Chen <dehao@google.com>2016-12-14 22:06:49 +0000
committerDehao Chen <dehao@google.com>2016-12-14 22:06:49 +0000
commit40dd8c510955de5bad344e3b31a325eb8481e292 (patch)
tree42854b630575598998e3ba51bf0b9fe1d2c5d32d /llvm/lib/Transforms
parentfb699619a0530632028a63ea4f04a6b979712429 (diff)
downloadbcm5719-llvm-40dd8c510955de5bad344e3b31a325eb8481e292.tar.gz
bcm5719-llvm-40dd8c510955de5bad344e3b31a325eb8481e292.zip
Only sets profile summary when it was not preset.
Summary: SampleProfileLoader pass may be invoked twice by LTO. The 2nd pass should not append more summary info as it is already preset by the 1st pass. Reviewers: eraman, davidxl Subscribers: mehdi_amini, llvm-commits Differential Revision: https://reviews.llvm.org/D27733 llvm-svn: 289725
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/IPO/SampleProfile.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/IPO/SampleProfile.cpp b/llvm/lib/Transforms/IPO/SampleProfile.cpp
index 30eda6b109e..6a43f8dbac4 100644
--- a/llvm/lib/Transforms/IPO/SampleProfile.cpp
+++ b/llvm/lib/Transforms/IPO/SampleProfile.cpp
@@ -1315,7 +1315,8 @@ bool SampleProfileLoader::runOnModule(Module &M) {
clearFunctionData();
retval |= runOnFunction(F);
}
- M.setProfileSummary(Reader->getSummary().getMD(M.getContext()));
+ if (M.getProfileSummary() == nullptr)
+ M.setProfileSummary(Reader->getSummary().getMD(M.getContext()));
return retval;
}
OpenPOWER on IntegriCloud