-
Notifications
You must be signed in to change notification settings - Fork 13.3k
make sure panic_nounwind_fmt can still be fully inlined (e.g. for panic_immediate_abort) #118362
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.