rust/compiler/rustc_middle
bors d53f0b1d8e Auto merge of #123244 - Mark-Simulacrum:share-inline-never-generics, r=saethlin
Enable -Zshare-generics for inline(never) functions

This avoids inlining cross-crate generic items when possible that are
already marked inline(never), implying that the author is not intending
for the function to be inlined by callers. As such, having a local copy
may make it easier for LLVM to optimize but mostly just adds to binary
bloat and codegen time. In practice our benchmarks indicate this is
indeed a win for larger compilations, where the extra cost in dynamic
linking to these symbols is diminished compared to the advantages in
fewer copies that need optimizing in each binary.

It might also make sense it expand this with other heuristics (e.g.,
`#[cold]`) in the future, but this seems like a good starting point.

FWIW, I expect that doing cleanup in where we make the decision
what should/shouldn't be shared is also a good idea. Way too
much code needed to be tweaked to check this. But I'm hoping
to leave that for a follow-up PR rather than blocking this on it.
2024-11-28 21:44:34 +00:00
..
src Auto merge of #123244 - Mark-Simulacrum:share-inline-never-generics, r=saethlin 2024-11-28 21:44:34 +00:00
Cargo.toml Delete the cfg(not(parallel)) serial compiler 2024-11-12 13:38:58 +00:00
messages.ftl Move some code from Compiler::enter to GlobalCtxt::finish 2024-11-09 17:55:39 +00:00
README.md

For more information about how rustc works, see the rustc dev guide.