[clang] fb3b392 - [docs] Add more complete documentation for -f[no]split-lto-unit

Teresa Johnson via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 13 11:34:22 PDT 2023


Author: Teresa Johnson
Date: 2023-03-13T11:33:46-07:00
New Revision: fb3b392264a099270b77ba7ebfb9d32817fc51d6

URL: https://github.com/llvm/llvm-project/commit/fb3b392264a099270b77ba7ebfb9d32817fc51d6
DIFF: https://github.com/llvm/llvm-project/commit/fb3b392264a099270b77ba7ebfb9d32817fc51d6.diff

LOG: [docs] Add more complete documentation for -f[no]split-lto-unit

Option was added in D53891, and only has basic documentation added
later in 5168ddfac44206e94f7ddd484d1cf03dee320fa7. Add more extensive
documentation with links to related docs.

Differential Revision: https://reviews.llvm.org/D145951

Added: 
    

Modified: 
    clang/docs/UsersManual.rst

Removed: 
    


################################################################################
diff  --git a/clang/docs/UsersManual.rst b/clang/docs/UsersManual.rst
index 0d5e960050c25..77b1c938c6ad4 100644
--- a/clang/docs/UsersManual.rst
+++ b/clang/docs/UsersManual.rst
@@ -2013,6 +2013,24 @@ are listed below.
    devirtualization and virtual constant propagation, for classes with
    :doc:`hidden LTO visibility <LTOVisibility>`. Requires ``-flto``.
 
+.. option:: -f[no]split-lto-unit
+
+   Controls splitting the :doc:`LTO unit <LTOVisibility>` into regular LTO and
+   :doc:`ThinLTO` portions, when compiling with -flto=thin. Defaults to false
+   unless ``-fsanitize=cfi`` or ``-fwhole-program-vtables`` are specified, in
+   which case it defaults to true. Splitting is required with ``fsanitize=cfi``,
+   and it is an error to disable via ``-fno-split-lto-unit``. Splitting is
+   optional with ``-fwhole-program-vtables``, however, it enables more
+   aggressive whole program vtable optimizations (specifically virtual constant
+   propagation).
+
+   When enabled, vtable definitions and select virtual functions are placed
+   in the split regular LTO module, enabling more aggressive whole program
+   vtable optimizations required for CFI and virtual constant propagation.
+   However, this can increase the LTO link time and memory requirements over
+   pure ThinLTO, as all split regular LTO modules are merged and LTO linked
+   with regular LTO.
+
 .. option:: -fforce-emit-vtables
 
    In order to improve devirtualization, forces emitting of vtables even in


        


More information about the cfe-commits mailing list