[all-commits] [llvm/llvm-project] ebb04b: [profcheck] Propagate profile metadata to Wrapper ...

Jin Huang via All-commits all-commits at lists.llvm.org
Fri Nov 21 11:17:49 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ebb04b2b4c38e6bb7b6068f3474a8e8edf912f4d
      https://github.com/llvm/llvm-project/commit/ebb04b2b4c38e6bb7b6068f3474a8e8edf912f4d
  Author: Jin Huang <jinhuang1102 at gmail.com>
  Date:   2025-11-21 (Fri, 21 Nov 2025)

  Changed paths:
    M llvm/lib/Transforms/IPO/ExpandVariadics.cpp
    M llvm/test/Transforms/ExpandVariadics/expand-va-intrinsic-split-linkage.ll
    M llvm/test/Transforms/ExpandVariadics/expand-va-intrinsic-split-simple.ll
    M llvm/test/Transforms/ExpandVariadics/intrinsics.ll

  Log Message:
  -----------
  [profcheck] Propagate profile metadata to Wrapper function in optimize mode of ExpandVariadic. (#168161)

This PR fixes the issue where profile metadata (`!prof`) is dropped from
the `VariadicWrapper` when `ExpandVariadics` runs in
`--expand-variadics-override=optimize` mode.

In optimize mode, the pass splits the original variadic function into
two parts:

- A **VariadicWrapper** (retaining the original name) that handles the
`va_list` setup.
- A **FixedArityReplacement** (new function) that contains the original
core logic.

During this process, the basic blocks and associated metadata are
spliced into the `FixedArityReplacement`. Consequently, the
`VariadicWrapper`—which serves as the entry point for callers—is left
without function entry count metadata.

This change explicitly copies the `MD_prof` metadata from the
`FixedArityReplacement` back to the `VariadicWrapper` after the split is
defined.

Co-authored-by: Jin Huang <jingold at google.com>



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