[PATCH] D20459: [profile] Add support for static counter allocation for value profiling (part-1)

David Li via llvm-commits llvm-commits at lists.llvm.org
Thu May 19 21:43:46 PDT 2016


davidxl added inline comments.

================
Comment at: lib/Transforms/Instrumentation/InstrProfiling.cpp:443
@@ +442,3 @@
+  uint64_t NumCounters = TotalNS * NumCountersPerValueSite;
+  // Heuristic for small programs with very few total value sites.
+  if (NumCounters < 10)
----------------
silvas wrote:
> Can you expand on the explanation here?
The small ratio we choose for #counters over  #of sites is based on the observation of large apps with large number of value sites, in which majority of them either have no profile or small number of values.  When the number of sites is small, we won't have this average effect. Ideally we should do this computation at link time -- but we will need to do this on a per-module basis. The value 10 can still be tuned -- for instance to make small programs like SPEC happy.


http://reviews.llvm.org/D20459





More information about the llvm-commits mailing list