[all-commits] [llvm/llvm-project] 79fff6: [lld][BP] Avoid ordering ICF'ed sections (#126327)

Ellis Hoag via All-commits all-commits at lists.llvm.org
Thu Feb 13 08:58:07 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 79fff6aa324c560f4a32d5d2b0276744a2c49668
      https://github.com/llvm/llvm-project/commit/79fff6aa324c560f4a32d5d2b0276744a2c49668
  Author: Ellis Hoag <ellis.sparky.hoag at gmail.com>
  Date:   2025-02-13 (Thu, 13 Feb 2025)

  Changed paths:
    M lld/ELF/BPSectionOrderer.cpp
    M lld/MachO/BPSectionOrderer.cpp
    M lld/test/ELF/bp-section-orderer.s
    M lld/test/MachO/bp-section-orderer.s

  Log Message:
  -----------
  [lld][BP] Avoid ordering ICF'ed sections (#126327)

ICF runs before BPSectionOrderer. When a section is ICF'ed, it seems
that the original sections are marked as not live, but are still kept
around. Prior to this patch, those ICF'ed sections would be passed to BP
and ordered before being skipped when writing the output. Now, these
sections are no longer passed to BP, saving runtime and possibly
improving BP's output.

In a large binary, I found that the number of sections ordered using BP
decreased, while the number of duplicate sections drastically decreased
as expected.
```
Functions for startup: 50755 -> 50520
Functions for compression: 165734 -> 105328
Duplicate functions: 1827231 -> 55230
```



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