[all-commits] [llvm/llvm-project] 29cd2c: [PGO] Add GPU wave counters

Yaxun (Sam) Liu via All-commits all-commits at lists.llvm.org
Tue Sep 22 21:40:45 PDT 2026


  Branch: refs/heads/users/yxsamliu/pgo-device-wave-counters
  Home:   https://github.com/llvm/llvm-project
  Commit: 29cd2c522b10b140cbae4d39a8a674accb7fc0f9
      https://github.com/llvm/llvm-project/commit/29cd2c522b10b140cbae4d39a8a674accb7fc0f9
  Author: Yaxun (Sam) Liu <yaxun.liu at amd.com>
  Date:   2026-09-22 (Tue, 22 Sep 2026)

  Changed paths:
    M compiler-rt/include/profile/InstrProfData.inc
    M compiler-rt/lib/profile/InstrProfiling.h
    M compiler-rt/lib/profile/InstrProfilingMerge.c
    M compiler-rt/lib/profile/InstrProfilingPlatformGPU.c
    M llvm/docs/InstrProfileFormat.md
    M llvm/include/llvm/ProfileData/InstrProf.h
    M llvm/include/llvm/ProfileData/InstrProfData.inc
    M llvm/include/llvm/ProfileData/InstrProfWriter.h
    M llvm/lib/ProfileData/InstrProf.cpp
    M llvm/lib/ProfileData/InstrProfReader.cpp
    M llvm/lib/ProfileData/InstrProfWriter.cpp
    M llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
    M llvm/test/Instrumentation/InstrProfiling/amdgpu-3d-grid.ll
    M llvm/test/Instrumentation/InstrProfiling/amdgpu-contiguous-counters.ll
    M llvm/test/Instrumentation/InstrProfiling/amdgpu-uniform-counters.ll
    M llvm/test/Instrumentation/InstrProfiling/amdgpu-wave32.ll
    M llvm/test/Instrumentation/InstrProfiling/amdgpu-wave64.ll
    M llvm/test/Instrumentation/InstrProfiling/coverage.ll
    A llvm/test/Instrumentation/InstrProfiling/gpu-wave-convergence.ll
    A llvm/test/Instrumentation/InstrProfiling/gpu-wave-counts.ll
    A llvm/test/Instrumentation/InstrProfiling/gpu-wave-inline.ll
    A llvm/test/Instrumentation/InstrProfiling/gpu-wave-link.ll
    M llvm/test/Transforms/PGOProfile/comdat_internal.ll
    A llvm/test/Transforms/PGOProfile/gpu-wave-counts.ll
    M llvm/test/Transforms/PGOProfile/instrprof_burst_sampling_fast.ll
    M llvm/test/Transforms/PGOProfile/vtable_profile.ll
    M llvm/test/tools/llvm-profdata/Inputs/c-general.profraw
    M llvm/test/tools/llvm-profdata/binary-ids-padding.test
    A llvm/test/tools/llvm-profdata/gpu-wave-counts.test
    M llvm/test/tools/llvm-profdata/insufficient-binary-ids-size.test
    M llvm/test/tools/llvm-profdata/large-binary-id-size.test
    M llvm/test/tools/llvm-profdata/malformed-not-space-for-another-header.test
    M llvm/test/tools/llvm-profdata/malformed-num-counters-zero.test
    M llvm/test/tools/llvm-profdata/malformed-ptr-to-counter-array.test
    M llvm/test/tools/llvm-profdata/malformed-uniform-counter-array.test
    M llvm/test/tools/llvm-profdata/misaligned-binary-ids-size.test
    M llvm/test/tools/llvm-profdata/profile-version.test
    M llvm/test/tools/llvm-profdata/raw-32-bits-be.test
    M llvm/test/tools/llvm-profdata/raw-32-bits-le.test
    M llvm/test/tools/llvm-profdata/raw-64-bits-be.test
    M llvm/test/tools/llvm-profdata/raw-64-bits-le.test
    M llvm/test/tools/llvm-profdata/raw-two-profiles.test
    M llvm/test/tools/llvm-profdata/truncated-profile.test
    M llvm/tools/llvm-profdata/llvm-profdata.cpp
    M llvm/unittests/ProfileData/InstrProfTest.cpp

  Log Message:
  -----------
  [PGO] Add GPU wave counters

Lane counts do not show how often a GPU wave reaches an instrumentation
point. A divergent wave can execute both paths even when few lanes take
one path.

Extend the GPU profiling helper to collect a wave count alongside each
existing lane counter. The first active lane increments the wave counter
once, using the same workgroup sampling decision as the lane counters.
Collect both channels together so shared functions use a consistent
counter layout across translation units. Workgroup sampling controls
profiling overhead.

Carry wave counts through raw and indexed profiles and weighted merging
as a separate channel. Preserve ordinary lane-flow counts and leave
blocks without instrumentation unmeasured.



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