[all-commits] [llvm/llvm-project] ae6d5d: [MemProf] Prune unneeded non-cold contexts (#124823)

Teresa Johnson via All-commits all-commits at lists.llvm.org
Wed Jan 29 10:38:53 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ae6d5dd58bcae9ced3b3c5b058876d3564017337
      https://github.com/llvm/llvm-project/commit/ae6d5dd58bcae9ced3b3c5b058876d3564017337
  Author: Teresa Johnson <tejohnson at google.com>
  Date:   2025-01-29 (Wed, 29 Jan 2025)

  Changed paths:
    M llvm/include/llvm/Analysis/MemoryProfileInfo.h
    M llvm/lib/Analysis/MemoryProfileInfo.cpp
    M llvm/test/Transforms/PGOProfile/memprof.ll
    M llvm/test/Transforms/PGOProfile/memprof_match_hot_cold_new_calls.ll
    M llvm/unittests/Analysis/MemoryProfileInfoTest.cpp

  Log Message:
  -----------
  [MemProf] Prune unneeded non-cold contexts (#124823)

We can take advantage of the fact that we subsequently only clone cold
allocation contexts, since not cold behavior is the default, and
significantly reduce the amount of metadata (and later ThinLTO summary
and MemProfContextDisambiguation graph nodes) by pruning unnecessary not
cold contexts when building metadata from the trie.

Specifically, we only need to keep notcold contexts that overlap the
longest with cold allocations, to know how deeply to clone those
contexts to expose the cold allocation behavior.

For a large target this reduced ThinLTO bitcode object sizes by about
35%. It reduced the ThinLTO indexing time by about half and the peak
ThinLTO indexing memory by about 20%.



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