[lld] [llvm] [LLVM][LTO] Factor out RTLib calls and allow them to be dropped (PR #98512)
Joseph Huber via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 11 13:04:29 PDT 2024
jhuber6 wrote:
> > Likely a combination of `--ffunction-sections` and `-Wl,--gc-sections` will remove the dead functions, but that doesn't stop `lld` from extracting it and forcing it through codegen, which adds over a second of link time as it stands if you include math definitions.
>
> Ok that would explain it. `-ffunction-sections` and `-Wl,--gc-sections` are both enabled by default for the Wasm target. But if there are link time savings due to less codegen that would still benefit us. Thanks.
Yeah, it'll make a difference if you're trying to do LTO with a static library that contains libcalls, which is a little niche but important for my use-case. I also wonder if we should do this by default for AMDGPU / NVPTX as well, @arsenm WDYT?
https://github.com/llvm/llvm-project/pull/98512
More information about the llvm-commits
mailing list