Make intrinsic fallback bodies cross-crate inlineable by Noratrieb · Pull Request #121309 · rust-lang/rust (original) (raw)
This change was prompted by the stage1 compiler spending 4% of its time when compiling the polymorphic-recursion MIR opt test in unlikely
.
Intrinsic fallback bodies like unlikely
should always be inlined, it's very silly if they are not. To do this, we enable the fallback bodies to be cross-crate inlineable. Not that this matters for our workloads since the compiler never actually uses the "fallback bodies", it just uses whatever was cfg(bootstrap)ped, so I've also added #[inline]
to those.
See the comments for more information.
r? oli-obk