llvm.org GIT mirror llvm / 163ac62
[Profile] dump ic value profile value/site-count histogram Differential Revision: http://reviews.google.com/D24783 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282017 91177308-0d34-0410-b5e6-96231b3b80d8 Xinliang David Li 3 years ago
2 changed file(s) with 14 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
6565 #ICSUM: Total Number of Indirect Call Sites : 3
6666 #ICSUM: Total Number of Sites With Values : 2
6767 #ICSUM: Total Number of Profiled Values : 3
68 #ICSUM: NumTargets, SiteCount
69 #ICSUM 1, 1
70 #ICSUM 2, 1
6871
462462 uint64_t TotalNumValueSites = 0;
463463 uint64_t TotalNumValueSitesWithValueProfile = 0;
464464 uint64_t TotalNumValues = 0;
465 std::vector ICHistogram;
465466 for (const auto &Func : *Reader) {
466467 bool Show =
467468 ShowAllFunctions || (!ShowFunction.empty() &&
514515 std::unique_ptr VD =
515516 Func.getValueForSite(IPVK_IndirectCallTarget, I);
516517 TotalNumValues += NV;
517 if (NV)
518 if (NV) {
518519 TotalNumValueSitesWithValueProfile++;
520 if (NV > ICHistogram.size())
521 ICHistogram.resize(NV, 0);
522 ICHistogram[NV - 1]++;
523 }
519524 for (uint32_t V = 0; V < NV; V++) {
520525 OS << "\t[ " << I << ", ";
521526 OS << Symtab.getFuncName(VD[V].Value) << ", " << VD[V].Count
542547 OS << "Total Number of Sites With Values : "
543548 << TotalNumValueSitesWithValueProfile << "\n";
544549 OS << "Total Number of Profiled Values : " << TotalNumValues << "\n";
550
551 OS << "IC Value histogram : \n\tNumTargets, SiteCount\n";
552 for (unsigned I = 0; I < ICHistogram.size(); I++) {
553 OS << "\t" << I + 1 << ", " << ICHistogram[I] << "\n";
554 }
545555 }
546556
547557 if (ShowDetailedSummary) {