[llvm] [PGO] Sampled instrumentation in PGO to speed up instrumentation binary (PR #69535)
David Li via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 24 10:47:10 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",
----------------
david-xl wrote:
The current sampling period is implicit to take advantage of the wrapping behavior to reduce runtime overhead (and code size) -- we don't want to lose that. However I think the implementation can check if the bursty duration is not one, assert that sampling period is not set. Otherwise, generate the non bursty style sampling.
https://github.com/llvm/llvm-project/pull/69535
More information about the llvm-commits
mailing list