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

Sean Silva via llvm-commits llvm-commits at lists.llvm.org
Thu May 19 21:31:39 PDT 2016


silvas added a subscriber: silvas.
silvas accepted this revision.
silvas added a reviewer: silvas.
silvas added a comment.
This revision is now accepted and ready to land.

This is very exciting. This will hopefully make VP feasible on PS4.

A couple small comments but this LGTM.


================
Comment at: lib/Transforms/Instrumentation/InstrProfiling.cpp:40
@@ +39,3 @@
+    "vp-counters-per-site",
+    cl::desc("The avverage number of profile counters allocated "
+             "per value profiling site."),
----------------
Typo avverage.

================
Comment at: lib/Transforms/Instrumentation/InstrProfiling.cpp:42
@@ +41,3 @@
+             "per value profiling site."),
+    // This is set to a very small value because in real programs, only
+    // a very small percentage of value sites have non-zero targets, e.g, 1/30.
----------------
This is a very interesting statistic.

================
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)
----------------
Can you expand on the explanation here?


http://reviews.llvm.org/D20459





More information about the llvm-commits mailing list