The inline lld::error expands to two function calls errorHandler and error
where the latter is opaque. Move the functions to .cpp files to decrease code
size.
My x86-64 lld executable is 9KiB smaller.
Differential D120002
[lld] Make error handling functions opaque MaskRay on Feb 16 2022, 8:30 PM. Authored by
Details
The inline lld::error expands to two function calls errorHandler and error My x86-64 lld executable is 9KiB smaller.
Diff Detail
Event TimelineComment Actions …do we really care about 9kiB of code? On my system, lld is 49730704 bytes, so that's a 0.2% reduction. Having 7 more lines of code seems worse than the benefit from that win – and that win probably only happens if you build lld without LTO. But /shrug, if you feel this is a good change, lg I suppose :) Comment Actions This saves instruction cache for some hot paths, though it's difficult to measure any improvement. Comment Actions
We should count liblld*.a, not every LLVM library pulled in by LTO. Then the ratio will be higher. |