Skip to content

Commit fb3b392

Browse files
committed
[docs] Add more complete documentation for -f[no]split-lto-unit
Option was added in D53891, and only has basic documentation added later in 5168ddf. Add more extensive documentation with links to related docs. Differential Revision: https://reviews.llvm.org/D145951
1 parent b7a3389 commit fb3b392

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

clang/docs/UsersManual.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2013,6 +2013,24 @@ are listed below.
20132013
devirtualization and virtual constant propagation, for classes with
20142014
:doc:`hidden LTO visibility <LTOVisibility>`. Requires ``-flto``.
20152015

2016+
.. option:: -f[no]split-lto-unit
2017+
2018+
Controls splitting the :doc:`LTO unit <LTOVisibility>` into regular LTO and
2019+
:doc:`ThinLTO` portions, when compiling with -flto=thin. Defaults to false
2020+
unless ``-fsanitize=cfi`` or ``-fwhole-program-vtables`` are specified, in
2021+
which case it defaults to true. Splitting is required with ``fsanitize=cfi``,
2022+
and it is an error to disable via ``-fno-split-lto-unit``. Splitting is
2023+
optional with ``-fwhole-program-vtables``, however, it enables more
2024+
aggressive whole program vtable optimizations (specifically virtual constant
2025+
propagation).
2026+
2027+
When enabled, vtable definitions and select virtual functions are placed
2028+
in the split regular LTO module, enabling more aggressive whole program
2029+
vtable optimizations required for CFI and virtual constant propagation.
2030+
However, this can increase the LTO link time and memory requirements over
2031+
pure ThinLTO, as all split regular LTO modules are merged and LTO linked
2032+
with regular LTO.
2033+
20162034
.. option:: -fforce-emit-vtables
20172035

20182036
In order to improve devirtualization, forces emitting of vtables even in

0 commit comments

Comments
 (0)