[all-commits] [llvm/llvm-project] a8ead5: [Transforms] Preserve wave profiles across CFG rew...

Yaxun (Sam) Liu via All-commits all-commits at lists.llvm.org
Thu Sep 24 08:06:30 PDT 2026


  Branch: refs/heads/users/yxsamliu/pgo-wave-cfg-preservation
  Home:   https://github.com/llvm/llvm-project
  Commit: a8ead55208851cfb3fa62c5f5c4e03cfefacf6fc
      https://github.com/llvm/llvm-project/commit/a8ead55208851cfb3fa62c5f5c4e03cfefacf6fc
  Author: Yaxun (Sam) Liu <yaxun.liu at amd.com>
  Date:   2026-09-24 (Thu, 24 Sep 2026)

  Changed paths:
    M llvm/include/llvm/IR/ProfDataUtils.h
    M llvm/lib/Transforms/Scalar/StructurizeCFG.cpp
    M llvm/lib/Transforms/Utils/LoopRotationUtils.cpp
    M llvm/lib/Transforms/Utils/LowerSwitch.cpp
    A llvm/test/Transforms/LoopRotate/wave-profile.ll
    A llvm/test/Transforms/LowerSwitch/profile-weights.ll
    A llvm/test/Transforms/LowerSwitch/wave-profile.ll
    A llvm/test/Transforms/StructurizeCFG/branch-profile-transfer.ll
    M llvm/test/Transforms/StructurizeCFG/uniformity-profile.ll
    A llvm/test/Transforms/StructurizeCFG/wave-profile-loop-prefix.ll
    A llvm/test/Transforms/StructurizeCFG/wave-profile.ll
    M llvm/unittests/Transforms/Utils/LoopRotationUtilsTest.cpp

  Log Message:
  -----------
  [Transforms] Preserve wave profiles across CFG rewrites

HIP device PGO attaches measured wave counts to IR blocks. Later CFG
rewrites can drop counts from unchanged blocks or leave stale counts
on blocks that now execute differently. Either case makes the profile
unreliable for later optimizations.

Preserve counts through switch lowering, structurization, and loop
rotation only when a block still represents the same executions. Keep
unaffected counts and their IDs even when a loop header's count must be
invalidated. Transfer branch hints only for equivalent decisions, and
avoid assigning switch weights when default traffic cannot be traced
to one edge.



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