[all-commits] [llvm/llvm-project] c63002: [NFC][StaticDataProfileInfo] Refactor StaticDataPr...

Mingming Liu via All-commits all-commits at lists.llvm.org
Tue Oct 14 21:15:53 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c63002eb9a7eafd2eab4f25b17d38f5fe73ae6b5
      https://github.com/llvm/llvm-project/commit/c63002eb9a7eafd2eab4f25b17d38f5fe73ae6b5
  Author: Mingming Liu <mingmingl at google.com>
  Date:   2025-10-14 (Tue, 14 Oct 2025)

  Changed paths:
    M llvm/include/llvm/Analysis/StaticDataProfileInfo.h
    M llvm/lib/Analysis/StaticDataProfileInfo.cpp

  Log Message:
  -----------
  [NFC][StaticDataProfileInfo] Refactor StaticDataProfileInfo::getConstantSectionPrefix and extract analysis based on PGO-counter to be a helper function (#162388)

`StaticDataProfileInfo::getConstantSectionPrefix` is used twice in
codegen ([1] and [2]) to emit section prefix for constants.

Before this patch, its implementation does analysis using PGO-counters,
and PGO-counters are only available on module-internal constants.

After this patch, the PGO-counter analysis are extracted to a helper
function, and returns enum rather than StringPrefix. This way, the
follow up patch https://github.com/llvm/llvm-project/pull/163325 can
extend this function to use global variable section prefix and compute a
max (the hotter one).

[1]
https://github.com/llvm/llvm-project/blob/975fba1b499422713e88cd6f374569f3bd38335e/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp#L3014-L3019
[2]
https://github.com/llvm/llvm-project/blob/975fba1b499422713e88cd6f374569f3bd38335e/llvm/lib/CodeGen/StaticDataAnnotator.cpp#L77-L84



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