[all-commits] [llvm/llvm-project] f04b27: [SampleProfile] Switch getNameTable() to return it...

Kazu Hirata via All-commits all-commits at lists.llvm.org
Fri Jun 5 11:03:48 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f04b27125ad150f3ca7488272cddc3a6341cbf15
      https://github.com/llvm/llvm-project/commit/f04b27125ad150f3ca7488272cddc3a6341cbf15
  Author: Kazu Hirata <kazu at google.com>
  Date:   2026-06-05 (Fri, 05 Jun 2026)

  Changed paths:
    M llvm/include/llvm/ProfileData/SampleProfReader.h
    M llvm/lib/Transforms/IPO/SampleProfile.cpp
    M llvm/lib/Transforms/IPO/SampleProfileMatcher.cpp

  Log Message:
  -----------
  [SampleProfile] Switch getNameTable() to return iterator_range (NFC) (#200995)

This patch teaches SampleProfileReader::getNameTable() to return an
iterator_range instead of a pointer to std::vector<FunctionId>.

This patch is meant to be a preparation patch for the following
speed-up opportunity.  I'm planning to lazy-load SecNameTable in a
subsequent patch for performance reasons.  We have SecNameTable that
takes up about 90MB on disk.  We eager-load this section into
std::vector<FunctionId> on the heap.  This ends up taking about 180MB
on the heap because the element type of the section is 8-byte MD5 hash
value while FunctionId takes up 16 bytes.  This eager loading shows up
on the execution profile -- about 1%.  Since we do have a few places
where we scan the entire NameTable, we should accommodate those places
with iterators that lazy-load SecNameTable.

See the RFC at:

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



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