[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 11:26:49 PDT 2024
jhuber6 wrote:
> Can you explain what you mean by "but cannot maintain the overhead of several unused function calls"?
>
Poorly worded, we don't want random functions that aren't used to sit around in the binary. If I do `-lm` it adds about 1.2 seconds of link time since it forces *every* single function to go through codegen. It also bloats the binary.
> My understanding is that these symbols are still only included in the final binary if they are actually required/referenced. The `handleLibcall` mechanism just forces them to be included/available during LTO compilation, it doesn't actually force them to be included in the output binary, does it?
No, they are extracted unconditionally if they are found and not allowed to be internalized. That's what this patch is trying to solve.
https://github.com/llvm/llvm-project/pull/98512
More information about the llvm-commits
mailing list