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

Allow inlining of ensure_sufficient_stack() #93934

Merged
merged 1 commit into from Feb 20, 2022

Conversation

hkratz
Copy link
Contributor

@hkratz hkratz commented Feb 12, 2022

This functions is monomorphized a lot and allowing the compiler to inline it improves instructions count and max RSS significantly in my local tests.

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Feb 12, 2022
@rust-highfive
Copy link
Collaborator

r? @estebank

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 12, 2022
@bjorn3
Copy link
Member

bjorn3 commented Feb 12, 2022

It should already be inlinable due to being generic, but maybe stacker::maybe_grow is inlined first and then LLVM considers the resulting function too big to be inlined by default?

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Feb 12, 2022
@bors
Copy link
Contributor

bors commented Feb 12, 2022

⌛ Trying commit 59536fb with merge a771d063e5e2bc102c8c9e1ec5674ed02904864c...

@bors
Copy link
Contributor

bors commented Feb 12, 2022

☀️ Try build successful - checks-actions
Build commit: a771d063e5e2bc102c8c9e1ec5674ed02904864c (a771d063e5e2bc102c8c9e1ec5674ed02904864c)

@rust-timer
Copy link
Collaborator

Queued a771d063e5e2bc102c8c9e1ec5674ed02904864c with parent 9cdefd7, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (a771d063e5e2bc102c8c9e1ec5674ed02904864c): comparison url.

Summary: This benchmark run shows 18 relevant improvements 🎉 to instruction counts.

  • Average relevant improvement: -0.5%
  • Largest improvement in instruction counts: -1.5% on incr-unchanged builds of clap-rs check

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR led to changes in compiler perf.

@bors rollup=never
@rustbot label: +S-waiting-on-review -S-waiting-on-perf -perf-regression

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Feb 12, 2022
@estebank
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Feb 17, 2022

📌 Commit 59536fb has been approved by estebank

@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 Feb 17, 2022
@bors
Copy link
Contributor

bors commented Feb 20, 2022

⌛ Testing commit 59536fb with merge c1aa854...

@bors
Copy link
Contributor

bors commented Feb 20, 2022

☀️ Test successful - checks-actions
Approved by: estebank
Pushing c1aa854 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Feb 20, 2022
@bors bors merged commit c1aa854 into rust-lang:master Feb 20, 2022
@rustbot rustbot added this to the 1.61.0 milestone Feb 20, 2022
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (c1aa854): comparison url.

Summary: This benchmark run shows 3 relevant improvements 🎉 but 3 relevant regressions 😿 to instruction counts.

  • Average relevant regression: 0.9%
  • Average relevant improvement: -0.8%
  • Largest improvement in instruction counts: -1.0% on incr-patched: add vec item builds of deep-vector opt
  • Largest regression in instruction counts: 0.9% on incr-unchanged builds of ctfe-stress-4 check

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

Next Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please open an issue or create a new PR that fixes the regressions, add a comment linking to the newly created issue or PR, and then add the perf-regression-triaged label to this PR.

@rustbot label: +perf-regression

@rustbot rustbot added the perf-regression Performance regression. label Feb 20, 2022
@hkratz
Copy link
Contributor Author

hkratz commented Feb 23, 2022

The trial perf run was before the LLVM 14 merge. It seems that the inlining behavior has changed so this isolated change is a wash now.

I have more optimizations for stacker lined up in #94099.

@rylev
Copy link
Member

rylev commented Feb 24, 2022

Agree that the change is now a wash.

@rustbot label: +perf-regression-triaged

@rustbot rustbot added the perf-regression-triaged The performance regression has been triaged. label Feb 24, 2022
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. perf-regression Performance regression. perf-regression-triaged The performance regression has been triaged. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler 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

8 participants