make sure panic_nounwind_fmt can still be fully inlined (e.g. for panic_immediate_abort)#118362
make sure panic_nounwind_fmt can still be fully inlined (e.g. for panic_immediate_abort)#118362bors merged 2 commits intorust-lang:masterfrom
Conversation
|
(rustbot has picked a reviewer for you, use r? to override) |
| #[cold] | ||
| #[cfg_attr(not(feature = "panic_immediate_abort"), inline(never))] | ||
| #[cfg_attr(not(feature = "panic_immediate_abort"), inline(never), cold)] | ||
| #[cfg_attr(feature = "panic_immediate_abort", inline)] |
There was a problem hiding this comment.
@saethlin is there any reason you used different attributes for this function than what all the others in this file do?
There was a problem hiding this comment.
Argh we should really have codegen tests for this feature. That would settle all this fiddling with attributes, or at least we could know that whatever is in the code works as intended. I'll open an issue later if I remember.
I think #[cold] discourages inlining but if the body has been optimized to just an unreachable terminator it still gets optimized away. Whether by the MIR inliner or LLVM I'm not sure.
|
r? libs |
|
LGTM @bors r+ |
|
☀️ Test successful - checks-actions |
|
Finished benchmarking commit (154f645): comparison URL. Overall result: ❌ regressions - no action needed@rustbot label: -perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 675.029s -> 674.255s (-0.11%) |
Follow-up to #110303.