summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ProfileData/InstrProf.cpp
diff options
context:
space:
mode:
authorXinliang David Li <davidxl@google.com>2016-02-03 04:08:18 +0000
committerXinliang David Li <davidxl@google.com>2016-02-03 04:08:18 +0000
commit6c93ee8d36261e197831f024ce65c26a110369db (patch)
tree81d4123997e48bf4a44a014724f0e205fab02420 /llvm/lib/ProfileData/InstrProf.cpp
parent0c0d7e2d0fbe58eb69db383ace48e68ecfd6f050 (diff)
downloadbcm5719-llvm-6c93ee8d36261e197831f024ce65c26a110369db.tar.gz
bcm5719-llvm-6c93ee8d36261e197831f024ce65c26a110369db.zip
[PGO] Profile summary reader/writer support
With this patch, the profile summary data will be available in indexed profile data file so that profiler reader/compiler optimizer can start to make use of. Differential Revision: http://reviews.llvm.org/D16258 llvm-svn: 259626
Diffstat (limited to 'llvm/lib/ProfileData/InstrProf.cpp')
-rw-r--r--llvm/lib/ProfileData/InstrProf.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/llvm/lib/ProfileData/InstrProf.cpp b/llvm/lib/ProfileData/InstrProf.cpp
index 0ccc16252c2..a06a4370d61 100644
--- a/llvm/lib/ProfileData/InstrProf.cpp
+++ b/llvm/lib/ProfileData/InstrProf.cpp
@@ -641,4 +641,19 @@ void ProfileSummary::computeDetailedSummary() {
}
}
+ProfileSummary::ProfileSummary(const IndexedInstrProf::Summary &S)
+ : TotalCount(S.get(IndexedInstrProf::Summary::TotalBlockCount)),
+ MaxBlockCount(S.get(IndexedInstrProf::Summary::MaxBlockCount)),
+ MaxInternalBlockCount(
+ S.get(IndexedInstrProf::Summary::MaxInternalBlockCount)),
+ MaxFunctionCount(S.get(IndexedInstrProf::Summary::MaxFunctionCount)),
+ NumBlocks(S.get(IndexedInstrProf::Summary::TotalNumBlocks)),
+ NumFunctions(S.get(IndexedInstrProf::Summary::TotalNumFunctions)) {
+ for (unsigned I = 0; I < S.NumCutoffEntries; I++) {
+ const IndexedInstrProf::Summary::Entry &Ent = S.getEntry(I);
+ DetailedSummary.emplace_back((uint32_t)Ent.Cutoff, Ent.MinBlockCount,
+ Ent.NumBlocks);
+ }
+}
+
} // end namespace llvm
OpenPOWER on IntegriCloud