[all-commits] [llvm/llvm-project] e3b30b: [lld][InstrProf] Profile guided function order (#9...

Ellis Hoag via All-commits all-commits at lists.llvm.org
Tue Jul 23 08:35:01 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e3b30bc553775f29661eebc8e022efa4cad91610
      https://github.com/llvm/llvm-project/commit/e3b30bc553775f29661eebc8e022efa4cad91610
  Author: Ellis Hoag <ellis.sparky.hoag at gmail.com>
  Date:   2024-07-23 (Tue, 23 Jul 2024)

  Changed paths:
    A lld/MachO/BPSectionOrderer.cpp
    A lld/MachO/BPSectionOrderer.h
    M lld/MachO/CMakeLists.txt
    M lld/MachO/Config.h
    M lld/MachO/Driver.cpp
    M lld/MachO/Options.td
    M lld/MachO/SectionPriorities.cpp
    A lld/test/MachO/bp-section-orderer-errs.s
    A lld/test/MachO/bp-section-orderer-stress.s
    A lld/test/MachO/bp-section-orderer.s

  Log Message:
  -----------
  [lld][InstrProf] Profile guided function order (#96268)

Add the lld flags `--irpgo-profile-sort=<profile>` and
`--compression-sort={function,data,both}` to order functions to improve
startup time, and functions or data to improve compressed size,
respectively.

We use Balanced Partitioning to determine the best section order using
traces from IRPGO profiles (see
https://discourse.llvm.org/t/rfc-temporal-profiling-extension-for-irpgo/68068
for details) to improve startup time and using hashes of section
contents to improve compressed size.

In our recent LLVM talk (https://www.youtube.com/watch?v=yd4pbSTjwuA),
we showed that this can reduce page faults during startup by 40% on a
large iOS app and we can reduce compressed size by 0.8-3%.

More details can be found in https://dl.acm.org/doi/10.1145/3660635

---------

Co-authored-by: Vincent Lee <thevinster at users.noreply.github.com>



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