[all-commits] [llvm/llvm-project] f4d705: [MemProf] Determine stack id references in Bitcode...

Teresa Johnson via All-commits all-commits at lists.llvm.org
Mon Jun 3 20:32:42 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f4d705871a073259c220b80026614d46d939cb5b
      https://github.com/llvm/llvm-project/commit/f4d705871a073259c220b80026614d46d939cb5b
  Author: Teresa Johnson <tejohnson at google.com>
  Date:   2024-06-03 (Mon, 03 Jun 2024)

  Changed paths:
    M llvm/lib/Bitcode/Writer/BitcodeWriter.cpp

  Log Message:
  -----------
  [MemProf] Determine stack id references in BitcodeWriter without sorting (#94285)

A cycle profile of a thin link showed a lot of time spent in sort called
from the BitcodeWriter, which was being used to compute the unique
references to stack ids in the summaries emitted for each backend in a
distributed thinlto build. We were also frequently invoking lower_bound
to locate stack id indices in the resulting vector when writing out the
referencing memprof records.

Change this to use a map to uniquify the references, and to hold the
index of the corresponding stack id in the StackIds vector, which is
now populated at the same time.

This reduced the time of a large thin link by about 10%.



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