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

[perf experiment] Increase the Rust ABI by-value arg/return size limit from 2*usize to 3*usize. #93268

Closed
wants to merge 1 commit into from

Conversation

eddyb
Copy link
Member

@eddyb eddyb commented Jan 24, 2022

(I had planned to try this as a regression fix for #93259, before the perf run for that came out neutral - but I've thought of it before, and this is one of those things I can never figure out if it's been tried and rejected)

In the interest of not changing the optimization behavior, I've left in the existing behavior of turning <= 2*usize aggregates into a single iN, even when it might not be ideal.

Not sure how to test this outside of using the compiler as a benchmark, but I suppose that's at least a start.

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

r? @oli-obk

(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 Jan 24, 2022
@eddyb
Copy link
Member Author

eddyb commented Jan 24, 2022

@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 Jan 24, 2022
@bors
Copy link
Contributor

bors commented Jan 24, 2022

⌛ Trying commit 3967fc6 with merge 929a3fb1b6d9a46a24879de882b85bfa1525d05e...

@bors
Copy link
Contributor

bors commented Jan 24, 2022

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

@rust-timer
Copy link
Collaborator

Queued 929a3fb1b6d9a46a24879de882b85bfa1525d05e with parent d2dc425, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (929a3fb1b6d9a46a24879de882b85bfa1525d05e): comparison url.

Summary: This change led to very large relevant mixed results 🤷 in compiler performance.

  • Very large improvement in instruction counts (up to -5.4% on incr-patched: println builds of syn opt)
  • Very large regression in instruction counts (up to 3624.3% on full builds of deep-vector debug)

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.

Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

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

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Jan 24, 2022
@eddyb
Copy link
Member Author

eddyb commented Jan 24, 2022

It's literally only deep-vector debug (that is that bad), woow everything else is under 10%.
(both deep-vector check and deep-vector opt are comparatively fine, under 1% regressions, if that)

The compiler seems to build faster across the board, which I'm not extremely surprised about - after all, that's where I got the idea in the first place. But it's not as big as I was hoping.

I'll close this but leave the branch around if anyone else wants to poke around at it.

@eddyb eddyb closed this Jan 24, 2022
@eddyb
Copy link
Member Author

eddyb commented Jan 24, 2022

Okay I forgot to check before: it's all in LLVM:
image

If anyone runs out of LLVM mysteries to look into, here's a free one (though the answer is likely very boring and just means this ABI trick is excessive, or I need to use i192 instead of [3 x i64]).
cc @nikic @nagisa

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
perf-regression Performance regression. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. 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.

6 participants