summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ProfileData/SampleProf.cpp
diff options
context:
space:
mode:
authorWei Mi <wmi@google.com>2018-09-06 22:03:37 +0000
committerWei Mi <wmi@google.com>2018-09-06 22:03:37 +0000
commit94d44c97bcffbf157b05a45c2f0e56302db9a03c (patch)
tree4d7274c699daa90d327ad6709ec3250865917133 /llvm/lib/ProfileData/SampleProf.cpp
parenta0a738b1840fa690a13937774a1a1e994cf58c4f (diff)
downloadbcm5719-llvm-94d44c97bcffbf157b05a45c2f0e56302db9a03c.tar.gz
bcm5719-llvm-94d44c97bcffbf157b05a45c2f0e56302db9a03c.zip
[SampleFDO] Make sample profile loader unaware of compact format change.
The patch tries to make sample profile loader independent of profile format change. It moves compact format related code into FunctionSamples and SampleProfileReader classes, and sample profile loader only has to interact with those two classes and will be unaware of profile format changes. The cleanup also contain some fixes to further remove the difference between compactbinary format and binary format. After the cleanup using different formats originated from the same profile will generate the same binaries, which we verified by compiling two large server benchmarks w/wo thinlto. Differential Revision: https://reviews.llvm.org/D51643 llvm-svn: 341591
Diffstat (limited to 'llvm/lib/ProfileData/SampleProf.cpp')
-rw-r--r--llvm/lib/ProfileData/SampleProf.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/ProfileData/SampleProf.cpp b/llvm/lib/ProfileData/SampleProf.cpp
index 30438ba7962..b0818d12475 100644
--- a/llvm/lib/ProfileData/SampleProf.cpp
+++ b/llvm/lib/ProfileData/SampleProf.cpp
@@ -26,6 +26,14 @@
using namespace llvm;
using namespace sampleprof;
+namespace llvm {
+namespace sampleprof {
+SampleProfileFormat FunctionSamples::Format;
+DenseMap<uint64_t, StringRef> FunctionSamples::GUIDToFuncNameMap;
+Module *FunctionSamples::CurrentModule;
+} // namespace sampleprof
+} // namespace llvm
+
namespace {
// FIXME: This class is only here to support the transition to llvm::Error. It
OpenPOWER on IntegriCloud