[all-commits] [llvm/llvm-project] b4fcaa: [PGO][SampledInstr] Correct off by 1s and allow 10...

mofarrell via All-commits all-commits at lists.llvm.org
Tue Oct 22 16:01:36 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b4fcaa137f057e68a9011b26c11627a16a8c9374
      https://github.com/llvm/llvm-project/commit/b4fcaa137f057e68a9011b26c11627a16a8c9374
  Author: Michael O'Farrell <micpof at gmail.com>
  Date:   2024-10-22 (Tue, 22 Oct 2024)

  Changed paths:
    M llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
    M llvm/test/Transforms/PGOProfile/counter_promo_sampling.ll
    M llvm/test/Transforms/PGOProfile/cspgo_sample.ll
    M llvm/test/Transforms/PGOProfile/instrprof_burst_sampling_fast.ll
    M llvm/test/Transforms/PGOProfile/instrprof_burst_sampling_full.ll
    M llvm/test/Transforms/PGOProfile/instrprof_burst_sampling_full_intsize.ll
    M llvm/test/Transforms/PGOProfile/instrprof_simple_sampling.ll

  Log Message:
  -----------
  [PGO][SampledInstr] Correct off by 1s and allow 100% sampling (#113350)

This corrects a couple off by ones related to the sampling of
**instrumented** counters, and enables setting 100% rates for burst
sampling (burst duration = period).

Off by ones:
Prior to this change it was impossible to set a period of 65535 because
this was converted to fast sampling which rollsover at USHRT_MAX + 1
(65536). Similarly the burst durations would collect burst duration + 1
counts as they used an ULE comparison.

100% sampling:
Although this is not useful for a productionized use case, it does allow
for more deterministic testing with the sampling checks in place. After
all the off by ones are fixed, allowing for 100% sampling is a matter of
letting burst duration = period.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list