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

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


  Branch: refs/heads/users/yxsamliu/pgo-wave-cfg-preservation
  Home:   https://github.com/llvm/llvm-project
  Commit: fd893a550a2832c71ae977d73db057b18116eda2
      https://github.com/llvm/llvm-project/commit/fd893a550a2832c71ae977d73db057b18116eda2
  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
    M llvm/test/CodeGen/AMDGPU/itofp.i128.bf.ll
    M llvm/test/CodeGen/AMDGPU/itofp.i128.ll
    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