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 SimplifyLocals before ConstProp. #105323

Merged
merged 5 commits into from
Jan 7, 2023

Conversation

cjgillot
Copy link
Contributor

@cjgillot cjgillot commented Dec 5, 2022

MIR before ConstProp may have a lot of dead writes, this makes ConstProp do unnecessary work.

r? @ghost

@rustbot rustbot added 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. labels Dec 5, 2022
@rustbot
Copy link
Collaborator

rustbot commented Dec 5, 2022

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

@cjgillot
Copy link
Contributor Author

cjgillot commented Dec 5, 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 Dec 5, 2022
@bors
Copy link
Contributor

bors commented Dec 5, 2022

⌛ Trying commit 188cf4001097ba58feedb4fd396ee1412b6a1bb6 with merge b7447ffcd791c86d0621a163caf0d6d11bbf3e65...

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Dec 5, 2022

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

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (b7447ffcd791c86d0621a163caf0d6d11bbf3e65): 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-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.7% [-0.9%, -0.6%] 4
Improvements ✅
(secondary)
-0.5% [-0.6%, -0.5%] 3
All ❌✅ (primary) -0.7% [-0.9%, -0.6%] 4

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)
2.8% [2.6%, 3.0%] 2
Regressions ❌
(secondary)
2.2% [2.2%, 2.2%] 1
Improvements ✅
(primary)
-1.6% [-3.2%, -0.0%] 2
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.6% [-3.2%, 3.0%] 4

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 Dec 5, 2022
@rust-log-analyzer

This comment has been minimized.

@cjgillot
Copy link
Contributor Author

cjgillot commented Dec 6, 2022

r? compiler

@bors

This comment was marked as resolved.

@rust-log-analyzer

This comment has been minimized.

@davidtwco
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Jan 7, 2023

📌 Commit a48127f has been approved by davidtwco

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

bors commented Jan 7, 2023

⌛ Testing commit a48127f with merge b1691f6...

@bors
Copy link
Contributor

bors commented Jan 7, 2023

☀️ Test successful - checks-actions
Approved by: davidtwco
Pushing b1691f6 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jan 7, 2023
@bors bors merged commit b1691f6 into rust-lang:master Jan 7, 2023
@rustbot rustbot added this to the 1.68.0 milestone Jan 7, 2023
@cjgillot cjgillot deleted the simplify-const-prop branch January 7, 2023 19:09
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (b1691f6): comparison URL.

Overall result: ❌✅ regressions and improvements - 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.7% [0.2%, 1.6%] 4
Regressions ❌
(secondary)
0.6% [0.6%, 0.6%] 1
Improvements ✅
(primary)
-0.6% [-0.8%, -0.5%] 4
Improvements ✅
(secondary)
-0.5% [-0.5%, -0.5%] 1
All ❌✅ (primary) 0.0% [-0.8%, 1.6%] 8

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)
9.2% [9.1%, 9.4%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-2.3% [-2.3%, -2.3%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 5.4% [-2.3%, 9.4%] 3

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)
2.0% [2.0%, 2.0%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.0% [2.0%, 2.0%] 1

@rustbot rustbot added the perf-regression Performance regression. label Jan 7, 2023
@Mark-Simulacrum
Copy link
Member

Regression appears to not be noise (at least in serde-derive). The previous perf run didn't show that regression, so I wonder if there were perhaps changes made after it, @cjgillot, that may have led to a regression were there wasn't one before?

@saethlin
Copy link
Member

I saw commentary about this in the t-compiler meeting today.

I have seen fluctuations of almost exactly that magnitude in serde_derive opt+full. The syn opt+full benchmark has a pretty incredible significance threshold, and I think whatever instability is driving that is bleeding into serde_derive.

@Mark-Simulacrum
Copy link
Member

https://perf.rust-lang.org/index.html?start=2022-12-08&end=b1691f6413a4afd7529ab309965123cc63e82021&benchmark=serde_derive-1.0.136&profile=opt&scenario=full&stat=instructions%3Au&kind=percentrelative:

image

This last change is the last data point there -- it seems pretty clearly outside the normal fluctuation range. I don't see corresponding negative changes, so I think it's not just instability that settles back to net-zero after some time.

@saethlin
Copy link
Member

saethlin commented Jan 13, 2023

Ah sorry I think I wasn't clear. I'm not saying this is noise. I'm saying that small perturbations to the input produce hard-to-predict swings of about this magnitude to this benchmark (examples of what I've seen below). And if that is the case, the regression in this benchmark is real, but the next perturbation to MIR optimizations is reasonably likely to accidentally cause the benchmark to swing back to its previous state.

https://perf.rust-lang.org/compare.html?start=7ac9572c48435b5342ad3550d6036bde835d37dc&end=11d6ba903e6762c93f69ccf2ece4c445cfc575ae&stat=instructions:u
https://perf.rust-lang.org/compare.html?start=7ac9572c48435b5342ad3550d6036bde835d37dc&end=ebf0d2d3df7ddf24af902c6cb1401231a299dc2d&stat=instructions:u
https://perf.rust-lang.org/compare.html?start=cc47b069983292e4ee8982d5dabe6301452c5f25&end=0c68d2596c4617e0a308139af6ad56d4ac858bf1&stat=instructions:u
https://perf.rust-lang.org/compare.html?start=657eefe2dcf18f76ac67a39945810128e101178c&end=8e6760e82a081fb624e777d52ef744c1def2f593&stat=instructions:u


But also squinting at this graph isn't exactly a statistical test, so who knows, this might actually be noise.

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.

8 participants