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

Perform simple scalar replacement of aggregates (SROA) MIR opt #102570

Merged
merged 4 commits into from Nov 16, 2022

Conversation

cjgillot
Copy link
Contributor

@cjgillot cjgillot commented Oct 2, 2022

This is a re-open of #85796

I copied the debuginfo implementation (first commit) from @eddyb's own SROA PR.

This pass replaces plain field accesses by simple locals when possible.
To be eligible, the replaced locals:

  • must not be enums or unions;
  • must not be used whole;
  • must not have their address taken.

The storage and deinit statements are duplicated on each created local.

cc @tmiasko who reviewed the former version of this PR.

@rust-highfive
Copy link
Collaborator

r? @nagisa

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

@rustbot
Copy link
Collaborator

rustbot commented Oct 2, 2022

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

Some changes occurred in compiler/rustc_codegen_gcc

cc @antoyo

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Oct 2, 2022
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 2, 2022
@nagisa
Copy link
Member

nagisa commented Oct 18, 2022

I don’t see myself finding the resources to get to reviewing this any time soon. I was kinda hoping to but all sorts of things keep coming up.

r? @rust-lang/wg-mir-opt

@nagisa
Copy link
Member

nagisa commented Oct 18, 2022

r? mir-opt

@rust-highfive rust-highfive assigned oli-obk and unassigned nagisa Oct 18, 2022
@oli-obk
Copy link
Contributor

oli-obk commented Nov 8, 2022

Please turn on this optimization in release mode so we can do a perf test and a crater run

@oli-obk
Copy link
Contributor

oli-obk commented Nov 8, 2022

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

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

bors commented Nov 8, 2022

⌛ Trying commit 7b36296ae89744037f9e407a004b4f46199005d7 with merge 015dbcea68b7642e2acc268b5c8f3e9086fc02ff...

@bors
Copy link
Contributor

bors commented Nov 8, 2022

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

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (015dbcea68b7642e2acc268b5c8f3e9086fc02ff): comparison URL.

Overall result: ✅ improvements - 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.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.3% [-0.4%, -0.2%] 21
Improvements ✅
(secondary)
-0.3% [-0.6%, -0.2%] 16
All ❌✅ (primary) -0.3% [-0.4%, -0.2%] 21

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)
- - 0
Improvements ✅
(primary)
-4.4% [-4.4%, -4.4%] 1
Improvements ✅
(secondary)
-3.6% [-7.8%, -1.8%] 6
All ❌✅ (primary) -4.4% [-4.4%, -4.4%] 1

Cycles

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

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Nov 8, 2022
@cjgillot
Copy link
Contributor Author

cjgillot commented Nov 9, 2022

@craterbot run mode=build-and-test

@craterbot
Copy link
Collaborator

👌 Experiment pr-102570 created and queued.
🤖 Automatically detected try build 015dbcea68b7642e2acc268b5c8f3e9086fc02ff
🔍 You can check out the queue and this experiment's details.

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot craterbot added S-waiting-on-crater Status: Waiting on a crater run to be completed. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 9, 2022
@craterbot
Copy link
Collaborator

🚧 Experiment pr-102570 is now running

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot
Copy link
Collaborator

🎉 Experiment pr-102570 is completed!
📊 132 regressed and 96 fixed (247718 total)
📰 Open the full report.

⚠️ If you notice any spurious failure please add them to the blacklist!
ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot craterbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-crater Status: Waiting on a crater run to be completed. labels Nov 10, 2022
@cjgillot
Copy link
Contributor Author

@craterbot
Copy link
Collaborator

👌 Experiment pr-102570-1 created and queued.
🤖 Automatically detected try build 015dbcea68b7642e2acc268b5c8f3e9086fc02ff
🔍 You can check out the queue and this experiment's details.

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@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 Nov 14, 2022
@bors
Copy link
Contributor

bors commented Nov 15, 2022

⌛ Testing commit c0a6f49382ff3b9a25d7b27a2333ac7cf7164297 with merge fd098f068cff3f04ef6c067eee0beda9343ccedc...

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Nov 15, 2022

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Nov 15, 2022
@cjgillot cjgillot force-pushed the deagg-debuginfo branch 2 times, most recently from a18de70 to 779007d Compare November 15, 2022 21:37
@cjgillot
Copy link
Contributor Author

Tweaked the test to avoid depending on panic=unwind/abort.
@bors r=oli-obk

@bors
Copy link
Contributor

bors commented Nov 15, 2022

📌 Commit a18de70 has been approved by oli-obk

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 Nov 15, 2022
@bors
Copy link
Contributor

bors commented Nov 15, 2022

⌛ Testing commit a18de70 with merge 79146ba...

@bors
Copy link
Contributor

bors commented Nov 16, 2022

☀️ Test successful - checks-actions
Approved by: oli-obk
Pushing 79146ba to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Nov 16, 2022
@bors bors merged commit 79146ba into rust-lang:master Nov 16, 2022
@rustbot rustbot added this to the 1.67.0 milestone Nov 16, 2022
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (79146ba): comparison URL.

Overall result: ❌ regressions - ACTION NEEDED

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
cc @rust-lang/wg-compiler-performance

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.2% [0.2%, 0.2%] 2
Regressions ❌
(secondary)
0.4% [0.2%, 0.8%] 6
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-1.4% [-1.4%, -1.4%] 1
All ❌✅ (primary) 0.2% [0.2%, 0.2%] 2

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)
1.7% [1.7%, 1.7%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-4.6% [-8.3%, -0.8%] 2
All ❌✅ (primary) - - 0

Cycles

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

@rustbot rustbot added the perf-regression Performance regression. label Nov 16, 2022
@cjgillot cjgillot deleted the deagg-debuginfo branch November 16, 2022 19:16
Aaron1011 pushed a commit to Aaron1011/rust that referenced this pull request Jan 6, 2023
Perform simple scalar replacement of aggregates (SROA) MIR opt

This is a re-open of rust-lang#85796

I copied the debuginfo implementation (first commit) from `@eddyb's` own SROA PR.

This pass replaces plain field accesses by simple locals when possible.
To be eligible, the replaced locals:
- must not be enums or unions;
- must not be used whole;
- must not have their address taken.

The storage and deinit statements are duplicated on each created local.

cc `@tmiasko` who reviewed the former version of this PR.
antoyo pushed a commit to antoyo/rust that referenced this pull request Jun 19, 2023
Perform simple scalar replacement of aggregates (SROA) MIR opt

This is a re-open of rust-lang#85796

I copied the debuginfo implementation (first commit) from `@eddyb's` own SROA PR.

This pass replaces plain field accesses by simple locals when possible.
To be eligible, the replaced locals:
- must not be enums or unions;
- must not be used whole;
- must not have their address taken.

The storage and deinit statements are duplicated on each created local.

cc `@tmiasko` who reviewed the former version of this PR.
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. 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

10 participants