ICF = Identical C(ode|OMDAT) Folding
This is the LLD ELF/COFF algorithm, adapted for MachO. So far, only `-icf all` is supported. In order to support `-icf safe`, we will need to port address-significance tables (`.addrsig` directives) to MachO, which will come in later diffs.
`check-{llvm,clang,lld}` have 0 regressions for `lld -icf all` vs. baseline ld64.
We only run ICF on `__TEXT,__text` for reasons explained in the block comment in `ConcatOutputSection.cpp`.
Here is the perf impact for linking `chromium_framekwork` on a Mac Pro (16-core Xeon W) for the non-ICF case vs. pre-ICF:
```
N Min Max Median Avg Stddev
x 20 4.27 4.44 4.34 4.349 0.043029977
+ 20 4.37 4.46 4.405 4.4115 0.025188761
Difference at 95.0% confidence
0.0625 +/- 0.0225658
1.43711% +/- 0.518873%
(Student's t, pooled s = 0.0352566)
```
Reviewed By: #lld-macho, int3
Differential Revision: https://reviews.llvm.org/D103292
73 lines
2.7 KiB
Plaintext
73 lines
2.7 KiB
Plaintext
--- !tapi-tbd
|
|
tbd-version: 4
|
|
targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos ]
|
|
uuids:
|
|
- target: x86_64-macos
|
|
value: 00000000-0000-0000-0000-000000000000
|
|
- target: x86_64-maccatalyst
|
|
value: 00000000-0000-0000-0000-000000000000
|
|
- target: arm64-macos
|
|
value: 00000000-0000-0000-0000-000000000001
|
|
install-name: '/usr/lib/libSystem.dylib'
|
|
current-version: 0001.001.1
|
|
reexported-libraries:
|
|
- targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos ]
|
|
libraries: [ '/usr/lib/system/libdyld.dylib',
|
|
'/usr/lib/system/libsystem_c.dylib',
|
|
'/usr/lib/system/libsystem_m.dylib' ]
|
|
--- !tapi-tbd
|
|
tbd-version: 4
|
|
targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos ]
|
|
uuids:
|
|
- target: x86_64-macos
|
|
value: 00000000-0000-0000-0000-000000000002
|
|
- target: x86_64-maccatalyst
|
|
value: 00000000-0000-0000-0000-000000000000
|
|
- target: arm64-macos
|
|
value: 00000000-0000-0000-0000-000000000003
|
|
install-name: '/usr/lib/system/libdyld.dylib'
|
|
current-version: 0001.001.1
|
|
parent-umbrella:
|
|
- targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos ]
|
|
umbrella: System
|
|
exports:
|
|
- targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos ]
|
|
symbols: [ dyld_stub_binder, __tlv_bootstrap ]
|
|
--- !tapi-tbd
|
|
tbd-version: 4
|
|
targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos ]
|
|
uuids:
|
|
- target: x86_64-macos
|
|
value: 00000000-0000-0000-0000-000000000003
|
|
- target: x86_64-maccatalyst
|
|
value: 00000000-0000-0000-0000-000000000000
|
|
- target: arm64-macos
|
|
value: 00000000-0000-0000-0000-000000000004
|
|
install-name: '/usr/lib/system/libsystem_c.dylib'
|
|
current-version: 0001.001.1
|
|
parent-umbrella:
|
|
- targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos ]
|
|
umbrella: System
|
|
exports:
|
|
- targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos ]
|
|
symbols: [ ]
|
|
--- !tapi-tbd
|
|
tbd-version: 4
|
|
targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos ]
|
|
uuids:
|
|
- target: x86_64-macos
|
|
value: 00000000-0000-0000-0000-000000000004
|
|
- target: x86_64-maccatalyst
|
|
value: 00000000-0000-0000-0000-000000000000
|
|
- target: arm64-macos
|
|
value: 00000000-0000-0000-0000-000000000005
|
|
install-name: '/usr/lib/system/libsystem_m.dylib'
|
|
current-version: 0001.001.1
|
|
parent-umbrella:
|
|
- targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos ]
|
|
umbrella: System
|
|
exports:
|
|
- targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos ]
|
|
symbols: [ ___nan, ___isnan, ___inf, ___isinf ]
|
|
...
|