Skip to content
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

make sure panic_nounwind_fmt can still be fully inlined (e.g. for panic_immediate_abort) #118362

Merged
merged 2 commits into from Dec 5, 2023

Conversation

RalfJung
Copy link
Member

Follow-up to #110303.

@rustbot
Copy link
Collaborator

rustbot commented Nov 27, 2023

r? @joshtriplett

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Nov 27, 2023
#[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)]
Copy link
Member Author

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?

Copy link
Member

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RalfJung
Copy link
Member Author

RalfJung commented Dec 2, 2023

r? libs

@rustbot rustbot assigned thomcc and unassigned joshtriplett Dec 2, 2023
@thomcc
Copy link
Member

thomcc commented Dec 5, 2023

LGTM

@bors r+

@bors
Copy link
Contributor

bors commented Dec 5, 2023

📌 Commit 8de5bd0 has been approved by thomcc

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 5, 2023
@bors
Copy link
Contributor

bors commented Dec 5, 2023

⌛ Testing commit 8de5bd0 with merge 154f645...

@bors
Copy link
Contributor

bors commented Dec 5, 2023

☀️ Test successful - checks-actions
Approved by: thomcc
Pushing 154f645 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Dec 5, 2023
@bors bors merged commit 154f645 into rust-lang:master Dec 5, 2023
12 checks passed
@rustbot rustbot added this to the 1.76.0 milestone Dec 5, 2023
@RalfJung RalfJung deleted the panic_nounwind branch December 5, 2023 14:21
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (154f645): comparison URL.

Overall result: ❌ regressions - no action needed

@rustbot label: -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.4% [0.4%, 0.4%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results

This 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.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
3.5% [3.5%, 3.5%] 1
Improvements ✅
(primary)
-2.0% [-2.0%, -2.0%] 1
Improvements ✅
(secondary)
-2.3% [-2.3%, -2.3%] 1
All ❌✅ (primary) -2.0% [-2.0%, -2.0%] 1

Cycles

Results

This 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.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-5.0% [-5.2%, -4.9%] 3
All ❌✅ (primary) - - 0

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 675.029s -> 674.255s (-0.11%)
Artifact size: 314.15 MiB -> 314.15 MiB (-0.00%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants