I don't think we want to check this in, but maybe lld should have a feature that's kind of like this one [1].
During a C++ compilation, inline functions can be codegen'd into many .o files, only to be then merged by the linker. If a class is dllexported, _all_ its inline member functions get codegen'd into _every_ TU that includes the header declaring the class. This generates lots of redundant work that can often be saved fairly easily, but there's currently no good way to ask the linker which inline functions have the "most" redundancy. This patch adds a "/redundancyReport:file" flag to lld-link. If present, lld-link will write a line with the three columns containing "total number of redundantly codegen'd bytes due to function, number of times function was present in linked-in obj files, name of function" for each function, sorted by total redundancy.
With some python scripts doing pretty heavy postprocessing of lld-link's output, I was able to reduce link.exe's memory consumption for linking blink_core.dll by 600MB / 6%, and the size of blink_core.ilk (which link.exe uses to do incremental linking) by 20%, see https://bugs.chromium.org/p/chromium/issues/detail?id=560475#c60 and the following 10 or so comments. Since so much post processing was needed, we probably don't want this feature, but maybe something like it. So just putting this out there in case someone else has a good idea upon seeing it.