[PATCH] D30752: [PGO] Refactor the valule profile dumping function for ease of adding other profile kind

David Li via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 8 12:46:45 PST 2017


davidxl added inline comments.


================
Comment at: tools/llvm-profdata/llvm-profdata.cpp:559
         uint32_t NS = Func.getNumValueSites(IPVK_IndirectCallTarget);
-        OS << "    Indirect Target Results: \n";
-        TotalNumValueSites += NS;
         for (size_t I = 0; I < NS; ++I) {
           uint32_t NV = Func.getNumValueDataForSite(IPVK_IndirectCallTarget, I);
----------------
Better to extract the driver loop into a common function, eg: traverseAllValueSites, and then pass a lambda/callback to do different things such as collect stats or dumping.


https://reviews.llvm.org/D30752





More information about the llvm-commits mailing list