Go to file
Rui Ueyama ddf71fc370 COFF: Initial implementation of Identical COMDAT Folding.
Identical COMDAT Folding (ICF) is an optimization to reduce binary
size by merging COMDAT sections that contain the same metadata,
actual data and relocations. MSVC link.exe and many other linkers
have this feature. LLD achieves on per with MSVC in terms produced
binary size with this patch.

This technique is pretty effective. For example, LLD's size is
reduced from 64MB to 54MB by enaling this optimization.

The algorithm implemented in this patch is extremely inefficient.
It puts all COMDAT sections into a set to identify duplicates.
Time to self-link with/without ICF are 3.3 and 320 seconds,
respectively. So this option roughly makes LLD 100x slower.
But it's okay as I wanted to achieve correctness first.
LLD is still able to link itself with this optimization.
I'm going to make it more efficient in followup patches.

Note that this optimization is *not* entirely safe. C/C++ require
different functions have different addresses. If your program
relies on that property, your program wouldn't work with ICF.
However, it's not going to be an issue on Windows because MSVC
link.exe turns ICF on by default. As long as your program works
with default settings (or not passing /opt:noicf), your program
would work with LLD too.

llvm-svn: 240519
2015-06-24 04:36:52 +00:00
clang Proper changing/restoring for CapturedStmtInfo, NFC. 2015-06-24 03:35:38 +00:00
clang-tools-extra [clang-tidy] Fix false positives in misc-macro-parentheses checker 2015-06-23 12:45:14 +00:00
compiler-rt Update SafeStack TODO in the safestack.cc 2015-06-23 22:26:48 +00:00
debuginfo-tests New round of fixes for "Always compile debuginfo-tests for the host triple" 2014-10-18 23:47:59 +00:00
libclc Use a more accurate implementation for exp 2015-05-13 03:55:09 +00:00
libcxx Mark a couple of features as 'in progress' 2015-06-23 20:48:55 +00:00
libcxxabi fallback_malloc: silence conversion warning (NFC) 2015-06-03 17:25:35 +00:00
libunwind Code cleanup: Reindent statements. 2015-05-30 14:00:39 +00:00
lld COFF: Initial implementation of Identical COMDAT Folding. 2015-06-24 04:36:52 +00:00
lldb Implement the "qSymbol" packet in order to be able to read queue information in debugserver and return the info in the stop reply packets. 2015-06-23 21:27:50 +00:00
llgo [llgo] cmd/llgoi: use line editor 2015-05-23 15:16:09 +00:00
llvm Don't repeat name in comments. 2015-06-24 03:19:35 +00:00
openmp Allow machine hierarchy expansion 2015-06-22 15:59:18 +00:00
polly Add support for srem instruction 2015-06-24 04:13:29 +00:00