[llvm] [PGO] Sampled instrumentation in PGO to speed up instrumentation binary (PR #69535)

Snehasish Kumar via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 24 10:17:38 PDT 2023


================
@@ -148,6 +150,16 @@ cl::opt<bool> SkipRetExitBlock(
     "skip-ret-exit-block", cl::init(true),
     cl::desc("Suppress counter promotion if exit blocks contain ret."));
 
+static cl::opt<bool>
+    SampledInstrument("sampled-instr", cl::ZeroOrMore, cl::init(false),
+                      cl::desc("Do PGO instrumentation sampling"));
+
+static cl::opt<unsigned> SampledInstrumentDuration(
+    "sampled-instr-duration",
----------------
snehasish wrote:

I like the idea of two flags and allowing users to choose the setting enabling to both bursty or conventional sampling. One suggestion would be to make `sampled-instr-period` a prime number (standard practice in hardware sampling).

https://github.com/llvm/llvm-project/pull/69535


More information about the llvm-commits mailing list