[all-commits] [llvm/llvm-project] 329ba5: [LTO][NFC] Free the GlobalResolutions map after fi...

Teresa Johnson via All-commits all-commits at lists.llvm.org
Wed Jan 3 07:20:11 PST 2024


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

  Changed paths:
    M llvm/include/llvm/LTO/LTO.h
    M llvm/lib/LTO/LTO.cpp

  Log Message:
  -----------
  [LTO][NFC] Free the GlobalResolutions map after final use (#76780)

The GlobalResolutions map was found to contribute ~9% of the peak
memory of a large thin link. However, we are essentially done with it
when we are about to compute cross module imports, which itself adds to
the peak memory due to the import and export lists (there is one use
just after importing but it can easily be moved before importing).

Move the last use up above importing, and free the GlobalResolutions
map after that (and before importing). To help guard against future
inadvertent use after it has been released, change it to a
std::optional.




More information about the All-commits mailing list