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

Make lowering pull-based #90204

Merged
merged 8 commits into from
Mar 31, 2022
Merged

Make lowering pull-based #90204

merged 8 commits into from
Mar 31, 2022

Conversation

cjgillot
Copy link
Contributor

@cjgillot cjgillot commented Oct 23, 2021

Based on #90451
Part of #88186

The current lowering code visits all the item-likes in the AST in order, and lowers them one by one.
This PR changes it to index the AST and then proceed to lowering on-demand. This is closer to the logic of query-based lowering.

@cjgillot cjgillot mentioned this pull request Oct 23, 2021
11 tasks
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@cjgillot
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

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

bors commented Oct 23, 2021

⌛ Trying commit 30c685c9a863546ffe3be12e65ec08fa38c15acb with merge 40908995bf1a9271ebb46383e84e7fb7238b5971...

@bors
Copy link
Contributor

bors commented Oct 23, 2021

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

@rust-timer
Copy link
Collaborator

Queued 40908995bf1a9271ebb46383e84e7fb7238b5971 with parent 55ccbd0, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (40908995bf1a9271ebb46383e84e7fb7238b5971): comparison url.

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

  • Small improvement in instruction counts (up to -1.4% on full builds of coercions)
  • Moderate regression in instruction counts (up to 2.1% on incr-full builds of ctfe-stress-4)

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. 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 Oct 23, 2021
@rust-log-analyzer

This comment has been minimized.

@cjgillot
Copy link
Contributor Author

r? @michaelwoerister

@apiraino apiraino added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Oct 28, 2021
@michaelwoerister
Copy link
Member

Thanks, @cjgillot! I hope to get to this next week.

@bors
Copy link
Contributor

bors commented Oct 28, 2021

☔ The latest upstream changes (presumably #90145) made this pull request unmergeable. Please resolve the merge conflicts.

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Nov 4, 2021

☔ The latest upstream changes (presumably #90564) made this pull request unmergeable. Please resolve the merge conflicts.

@michaelwoerister
Copy link
Member

Marking this as blocked on #90451 for now.

@michaelwoerister michaelwoerister added S-blocked Status: Blocked on something else such as an RFC or other implementation work. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 17, 2021
@bors
Copy link
Contributor

bors commented Mar 15, 2022

☔ The latest upstream changes (presumably #94584) made this pull request unmergeable. Please resolve the merge conflicts.

@michaelwoerister
Copy link
Member

Do you think that some of the performance will be recovered once the whole refactoring is done?
Overall, the performance hit of this PR doesn't look very big. IMO, it's not a blocking issue.

@cjgillot
Copy link
Contributor Author

Do you think that some of the performance will be recovered once the whole refactoring is done?

I don't know, though I hope so. For now, #88186 is a perf regression (up to 4% on primary benchmarks, up to 11% with stress benchmarks). If we want to skip parts of lowering altogether, we will need in addition:

@michaelwoerister
Copy link
Member

OK, as stated before, I think the performance hit is acceptable as it should not be noticeable in any of the real-world benchmarks. You can r=me after rebasing. Thanks for all the hard work you are putting into this!

@cjgillot
Copy link
Contributor Author

@bors r=michaelwoerister

@bors
Copy link
Contributor

bors commented Mar 31, 2022

📌 Commit 6b099db has been approved by michaelwoerister

@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 Mar 31, 2022
@bors
Copy link
Contributor

bors commented Mar 31, 2022

⌛ Testing commit 6b099db with merge bd1a869...

@bors
Copy link
Contributor

bors commented Mar 31, 2022

☀️ Test successful - checks-actions
Approved by: michaelwoerister
Pushing bd1a869 to master...

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

Finished benchmarking commit (bd1a869): comparison url.

Summary: This benchmark run shows 35 relevant regressions 😿 to instruction counts.

  • Arithmetic mean of relevant regressions: 0.6%
  • Largest regression in instruction counts: 1.7% on full builds of unused-warnings 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

@cjgillot cjgillot deleted the owner-pull branch March 31, 2022 21:56
@rylev
Copy link
Member

rylev commented Apr 5, 2022

Marking this as triaged since a justification was already given here.

@rustbot label +perf-regression-triaged

@rustbot rustbot added the perf-regression-triaged The performance regression has been triaged. label Apr 5, 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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants