[all-commits] [llvm/llvm-project] ed4090: [SampleProfile] Fix symbol partitioning in Eytzing...

Kazu Hirata via All-commits all-commits at lists.llvm.org
Mon Jul 27 23:17:24 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ed4090047fb6c40d8d014559da16cee934f124c0
      https://github.com/llvm/llvm-project/commit/ed4090047fb6c40d8d014559da16cee934f124c0
  Author: Kazu Hirata <kazu at google.com>
  Date:   2026-07-27 (Mon, 27 Jul 2026)

  Changed paths:
    M llvm/include/llvm/ProfileData/SampleProf.h
    M llvm/lib/ProfileData/SampleProfWriter.cpp
    A llvm/test/tools/llvm-profdata/eytzinger-split-nametable-partition.test

  Log Message:
  -----------
  [SampleProfile] Fix symbol partitioning in Eytzinger name table (#211906)

This patch fixes the symbol partitioning between context-sensitive
and flat profiles in writeEytzingerNameTableSection.

In split-layout profiles, top-level symbols in the Eytzinger name
table are partitioned into two bins -- context-sensitive and flat keys
-- so that they form parallel arrays with function offsets.

Without this patch, writeEytzingerNameTableSection uses:

  if (Ctx.hasContext())

to decide which bin to use even though splitProfileMapToTwo uses:

  if (!I.second.getCallsiteSamples().empty())

to partition the profile.  This difference causes certain symbols to
be classified into FlatKeys in the name table but into
ContextProfileMap in the LBR profile.

The patch fixes the problem by using the same condition to partition
keys.

This misclassification happens to top-level symbols (like main or
un-inlined root callers) that lack context delimiters in their
function names (hasContext() == false) but still contain inlined
callees in their profile hierarchies.

RFC:
https://discourse.llvm.org/t/rfc-faster-sample-profile-loading/90957/8

Assisted-by: Antigravity



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