[all-commits] [llvm/llvm-project] 3ec2de: [MemProf] Optionally save context size info on lar...

Teresa Johnson via All-commits all-commits at lists.llvm.org
Wed Jun 4 13:09:18 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3ec2de2753388c83fa31bb65f0583aed625a2b32
      https://github.com/llvm/llvm-project/commit/3ec2de2753388c83fa31bb65f0583aed625a2b32
  Author: Teresa Johnson <tejohnson at google.com>
  Date:   2025-06-04 (Wed, 04 Jun 2025)

  Changed paths:
    M llvm/include/llvm/Analysis/MemoryProfileInfo.h
    M llvm/lib/Analysis/MemoryProfileInfo.cpp
    M llvm/lib/Analysis/ModuleSummaryAnalysis.cpp
    M llvm/lib/Bitcode/Reader/BitcodeReader.cpp
    M llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
    M llvm/lib/Transforms/IPO/MemProfContextDisambiguation.cpp
    M llvm/lib/Transforms/Instrumentation/MemProfiler.cpp
    A llvm/test/ThinLTO/X86/memprof-report-hinted-partial.ll
    A llvm/test/Transforms/PGOProfile/memprof_max_cold_threshold.test

  Log Message:
  -----------
  [MemProf] Optionally save context size info on largest cold allocations (#142837)

Reapply PR142507 with fix for test: add in the same x86_64-linux
requirement as other tests as the stack ids are currently computed
differently on big endian systems. This will be investigated separately.

In order to allow selective reporting of context hinting during the LTO
link, and in the future to allow selective more aggressive cloning, add
an option to specify a minimum percent of the max cold size in the
profile summary. Contexts that meet that threshold will get context size
info metadata (and ThinLTO summary information) on the associated
allocations.

Specifying -memprof-report-hinted-sizes during the pre-LTO compile step
will continue to cause all contexts to receive this metadata. But
specifying -memprof-report-hinted-sizes only during the LTO link will
cause only those that meet the new threshold and have the metadata to
get reported.

To support this, because the alloc info summary and associated bitcode
requires the context size information to be in the same order as the
other context information, 0s are inserted for contexts without this
metadata. The bitcode writer uses a more compact format for the context
ids to allow better compression of the 0s.

As part of this change several helper methods are added to query whether
metadata contains context size info on any or all contexts.



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