[llvm] [PGO][SampledInstr] Correct off by 1s and allow 100% sampling (PR #113350)

via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 22 12:01:25 PDT 2024


================
@@ -184,21 +184,48 @@ static cl::opt<unsigned> SampledInstrPeriod(
     cl::desc("Set the profile instrumentation sample period. For each sample "
              "period, a fixed number of consecutive samples will be recorded. "
              "The number is controlled by 'sampled-instr-burst-duration' flag. "
-             "The default sample period of 65535 is optimized for generating "
+             "The default sample period of 65536 is optimized for generating "
              "efficient code that leverages unsigned integer wrapping in "
              "overflow."),
-    cl::init(65535));
+    cl::init(USHRT_MAX + 1));
 
 static cl::opt<unsigned> SampledInstrBurstDuration(
----------------
xur-llvm wrote:

Mention 0 is not a valid value.

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


More information about the llvm-commits mailing list