[all-commits] [llvm/llvm-project] f2d827: [profcheck] Require `unknown` metadata have an ori...

Mircea Trofin via All-commits all-commits at lists.llvm.org
Wed Sep 10 15:34:56 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f2d827c444d07b722a94689b427d6ad2d1c6b1b7
      https://github.com/llvm/llvm-project/commit/f2d827c444d07b722a94689b427d6ad2d1c6b1b7
  Author: Mircea Trofin <mtrofin at google.com>
  Date:   2025-09-10 (Wed, 10 Sep 2025)

  Changed paths:
    M llvm/include/llvm/IR/ProfDataUtils.h
    M llvm/lib/IR/ProfDataUtils.cpp
    M llvm/lib/IR/Verifier.cpp
    M llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp
    M llvm/lib/Transforms/Scalar/JumpTableToSwitch.cpp
    M llvm/test/Transforms/JumpTableToSwitch/basic.ll
    M llvm/test/Transforms/PGOProfile/prof-inject-existing.ll
    M llvm/test/Transforms/PGOProfile/prof-verify-existing.ll
    M llvm/test/Transforms/WholeProgramDevirt/branch-funnel-profile.ll
    M llvm/test/Verifier/branch-weight.ll

  Log Message:
  -----------
  [profcheck] Require `unknown` metadata have an origin parameter (#157594)

Rather than passes using `!prof = !{!”unknown”}`​for cases where don’t have enough information to emit profile values, this patch captures the pass (or some other information) that can help diagnostics - i.e. `!{!”unknown”, !”some-pass-name”}`​.

For example, suppose we emitted a `select`​ with the unknown metadata, and, later, end up needing to lower that to a conditional branch. If we observe (via sample profiling, for example) that the branch is biased and would have benefitted from a valid profile, the extra information can help speed up debugging.

We can also (in a subsequent pass) generate optimization remarks about such lowered selects, with a similar aim - identify patterns lowering to `select`​ that may be worth some extra investment in extracting a more precise profile.



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