[llvm-branch-commits] [llvm] 9373c49 - LTO: Pass more aggresive optimization options

Tobias Hieta via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Feb 1 05:10:01 PST 2021


Author: Tobias Hieta
Date: 2020-12-29T09:16:31+01:00
New Revision: 9373c496c2eaeea19ed8e6c6d1b4ab0d488279fb

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

LOG: LTO: Pass more aggresive optimization options

Added: 
    

Modified: 
    llvm/cmake/modules/HandleLLVMOptions.cmake

Removed: 
    


################################################################################
diff  --git a/llvm/cmake/modules/HandleLLVMOptions.cmake b/llvm/cmake/modules/HandleLLVMOptions.cmake
index 5ef22eb493ba..c929cb5abe52 100644
--- a/llvm/cmake/modules/HandleLLVMOptions.cmake
+++ b/llvm/cmake/modules/HandleLLVMOptions.cmake
@@ -956,9 +956,9 @@ if(LLVM_ENABLE_LTO AND LLVM_ON_WIN32 AND NOT LINKER_IS_LLD_LINK AND NOT MINGW)
   message(FATAL_ERROR "When compiling for Windows, LLVM_ENABLE_LTO requires using lld as the linker (point CMAKE_LINKER at lld-link.exe)")
 endif()
 if(uppercase_LLVM_ENABLE_LTO STREQUAL "THIN")
-  append("-flto=thin" CMAKE_CXX_FLAGS CMAKE_C_FLAGS)
+  append("-flto=thin -fwhole-program-vtables" CMAKE_CXX_FLAGS CMAKE_C_FLAGS)
   if(NOT LINKER_IS_LLD_LINK)
-    append("-flto=thin" CMAKE_EXE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS)
+    append("-flto=thin -fwhole-program-vtables -Wl,--lto-whole-program-visibility -Wl,--icf=all" CMAKE_EXE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS)
   endif()
   # If the linker supports it, enable the lto cache. This improves initial build
   # time a little since we re-link a lot of the same objects, and significantly


        


More information about the llvm-branch-commits mailing list