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

Shrink FnAbi #100999

Merged
merged 7 commits into from
Aug 27, 2022
Merged

Shrink FnAbi #100999

merged 7 commits into from
Aug 27, 2022

Conversation

nnethercote
Copy link
Contributor

@nnethercote nnethercote commented Aug 25, 2022

Because they can take up a lot of memory in debug and release builds.

r? @bjorn3

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

rustbot commented Aug 25, 2022

Some changes occurred in compiler/rustc_codegen_gcc

cc @antoyo

Some changes occurred in compiler/rustc_codegen_cranelift

cc @bjorn3

Some changes occurred to the CTFE / Miri engine

cc @rust-lang/miri

@nnethercote nnethercote changed the title Shrink fn abi Shrink FnAbi Aug 25, 2022
@nnethercote
Copy link
Contributor Author

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

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

@bors
Copy link
Contributor

bors commented Aug 25, 2022

⌛ Trying commit 71c4b14a9585e2595cd28fdff1975ebf558d1686 with merge 0866a29e0084cb0441c0a82a9aa5e1853d404e2a...

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

bors commented Aug 25, 2022

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

@rust-timer
Copy link
Collaborator

Queued 0866a29e0084cb0441c0a82a9aa5e1853d404e2a with parent 4d45b07, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (0866a29e0084cb0441c0a82a9aa5e1853d404e2a): comparison URL.

Overall result: ❌ regressions - no action needed

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 may lead to changes in compiler perf.

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

Instruction count

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

mean1 range count2
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.2% [0.2%, 0.2%] 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.

mean1 range count2
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
2.1% [2.1%, 2.1%] 1
Improvements ✅
(primary)
-3.2% [-7.1%, -1.8%] 8
Improvements ✅
(secondary)
-2.6% [-2.6%, -2.6%] 1
All ❌✅ (primary) -3.2% [-7.1%, -1.8%] 8

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.

mean1 range count2
Regressions ❌
(primary)
2.2% [2.2%, 2.2%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.8% [-3.9%, -2.1%] 5
All ❌✅ (primary) 2.2% [2.2%, 2.2%] 1

Footnotes

  1. the arithmetic mean of the percent change 2 3

  2. number of relevant changes 2 3

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Aug 25, 2022
@nnethercote
Copy link
Contributor Author

A few very nice wins for max-rss, all in the opt and debug builds, which are the only ones affected by this change. Particularly for some of the larger benchmarks. And if you check the "Show non-relevant results" box, you'll see more green, for ones that don't meet the significance threshold (because max-rss is noisy) but are probably real (because there are so many of them, and it lines up with the significant ones). Also some hints of small speedups in the cycles and wall-time results.

Because `PassMode::Cast` is by far the largest variant, but is
relatively rare.

This requires making `PassMode` not impl `Copy`, and `Clone` is no
longer necessary. This causes lots of sigil adjusting, but nothing very
notable.
Currently they try to be very precise. But they are wrong, i.e. they
don't match what's happening in the loop below. This code isn't hot
enough for it to matter that much.
Because it's only ever set to `None` or `Some(Reg::i32())`.
Because it's only needed for that variant. This shrinks the types and
clarifies the logic.
@nnethercote
Copy link
Contributor Author

r? @bjorn3

@bjorn3
Copy link
Member

bjorn3 commented Aug 26, 2022

@bors r+ rollup=never

@bors
Copy link
Contributor

bors commented Aug 26, 2022

📌 Commit f974617 has been approved by bjorn3

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 Aug 26, 2022
@bors
Copy link
Contributor

bors commented Aug 27, 2022

⌛ Testing commit f974617 with merge 332cc8f...

@bors
Copy link
Contributor

bors commented Aug 27, 2022

☀️ Test successful - checks-actions
Approved by: bjorn3
Pushing 332cc8f to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Aug 27, 2022
@bors bors merged commit 332cc8f into rust-lang:master Aug 27, 2022
@rustbot rustbot added this to the 1.65.0 milestone Aug 27, 2022
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (332cc8f): 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.

mean1 range count2
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
1.3% [1.3%, 1.3%] 2
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.

mean1 range count2
Regressions ❌
(primary)
3.8% [3.8%, 3.8%] 1
Regressions ❌
(secondary)
3.3% [3.3%, 3.3%] 1
Improvements ✅
(primary)
-3.9% [-7.9%, -2.6%] 5
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -2.6% [-7.9%, 3.8%] 6

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.

mean1 range count2
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
3.7% [3.7%, 3.7%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.9% [-3.9%, -3.9%] 1
All ❌✅ (primary) - - 0

Footnotes

  1. the arithmetic mean of the percent change 2 3

  2. number of relevant changes 2 3

@nnethercote nnethercote deleted the shrink-FnAbi branch August 28, 2022 22:40
bjorn3 pushed a commit to bjorn3/rust that referenced this pull request Oct 23, 2022
Shrink `FnAbi`

Because they can take up a lot of memory in debug and release builds.

r? `@bjorn3`
antoyo pushed a commit to antoyo/rust that referenced this pull request Jun 19, 2023
Shrink `FnAbi`

Because they can take up a lot of memory in debug and release builds.

r? `@bjorn3`
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-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

6 participants