[all-commits] [llvm/llvm-project] 375793: [PGO] Load GPU wave counts into IR metadata

Yaxun (Sam) Liu via All-commits all-commits at lists.llvm.org
Wed Sep 23 13:02:50 PDT 2026


  Branch: refs/heads/users/yxsamliu/pgo-wave-profile-loader
  Home:   https://github.com/llvm/llvm-project
  Commit: 37579324fb5bfeb50b3e4c0eb3eb100bb12cd3f2
      https://github.com/llvm/llvm-project/commit/37579324fb5bfeb50b3e4c0eb3eb100bb12cd3f2
  Author: Yaxun (Sam) Liu <yaxun.liu at amd.com>
  Date:   2026-09-23 (Wed, 23 Sep 2026)

  Changed paths:
    M llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
    A llvm/test/Transforms/PGOProfile/wave-profile-use.ll

  Log Message:
  -----------
  [PGO] Load GPU wave counts into IR metadata

GPU profiles contain wave counts alongside lane counts, but profile use
does not expose them to optimizations. Wave visits do not obey scalar
flow conservation, so unmeasured blocks cannot use counts reconstructed
from neighboring blocks or ordinary branch weights.

Map wave-counter indices to the blocks selected by PGO instrumentation,
after reproducing its critical-edge splits. Attach measured counts using
wave.profile metadata, retaining measured zeros and marking other blocks
unmeasured. Require a measured entry count for normalization and exclude
select-counter slots from the block mapping.

Validate the wave-counter layout against the accepted lane profile.
Clear old wave metadata when loading a replacement profile, including
when a function has no usable record. Do not emit wave metadata for
previously profiled functions: their branch weights may change counter
placement without changing the CFG hash. Keep ordinary lane-count
reconstruction and branch weights unchanged.



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