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

Move ty::print methods to Drop-based scope guards #94062

Merged
merged 1 commit into from
Feb 20, 2022

Conversation

Mark-Simulacrum
Copy link
Member

@Mark-Simulacrum Mark-Simulacrum commented Feb 16, 2022

Primary goal is reducing codegen of the TLS access for each closure, which shaves ~3 seconds of bootstrap time over rustc as a whole.

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Feb 16, 2022
@Mark-Simulacrum

This comment was marked as resolved.

@rust-timer

This comment was marked as resolved.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Feb 16, 2022
@bors

This comment was marked as resolved.

@bors

This comment was marked as resolved.

@rust-timer

This comment was marked as resolved.

@rust-timer

This comment was marked as outdated.

@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 Feb 16, 2022
@Mark-Simulacrum Mark-Simulacrum added the perf-regression-triaged The performance regression has been triaged. label Feb 16, 2022
@Mark-Simulacrum
Copy link
Member Author

Mark-Simulacrum commented Feb 16, 2022

cc @antoyo and @bjorn3 on the codegen_gcc/cranelift changes (highfive didn't poke because I r'd ghost initially)

@bors try @rust-timer queue after moving to a macro -- shouldn't really matter for codegen perf, though.

r? rust-lang/compiler

Overall the perf improvement for bootstrap time here is pretty significant -- 3 seconds is a good chunk. The regression is IMO not significant enough (and pretty likely to be just optimizer noise) to block this PR from moving ahead.

@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 Feb 16, 2022
@bors
Copy link
Contributor

bors commented Feb 16, 2022

⌛ Trying commit 9763486 with merge 9052094ca5c51a6d68127658c18be082df1893b9...

@bors
Copy link
Contributor

bors commented Feb 16, 2022

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

@rust-timer
Copy link
Collaborator

Queued 9052094ca5c51a6d68127658c18be082df1893b9 with parent 75d9a0a, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (9052094ca5c51a6d68127658c18be082df1893b9): comparison url.

Summary: This benchmark run shows 13 relevant improvements 🎉 but 9 relevant regressions 😿 to instruction counts.

  • Average relevant regression: 0.8%
  • Average relevant improvement: -1.2%
  • Largest improvement in instruction counts: -1.7% on full builds of match-stress-enum check
  • Largest regression in instruction counts: 1.0% on full builds of inflate check

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 removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Feb 17, 2022
@rust-timer

This comment was marked as resolved.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Feb 17, 2022
@Mark-Simulacrum Mark-Simulacrum removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Feb 17, 2022
@oli-obk
Copy link
Contributor

oli-obk commented Feb 17, 2022

@bors r+

How did you find this? Did it show up in cachegrind dumps?

@bors
Copy link
Contributor

bors commented Feb 17, 2022

📌 Commit 9763486 has been approved by oli-obk

@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 Feb 17, 2022
@Mark-Simulacrum
Copy link
Member Author

No, cachegrind isn't really the right tool for tracing back to source code from LLVM IR. I'm looking at no-prepopulate-passes LLVM IR from rustc_query_impl and trying to identify duplicated work based on that (e.g., places where we're generating a lot of IR for no good reason).

Copy link
Contributor

@antoyo antoyo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The gcc part looks good to me.

@bors
Copy link
Contributor

bors commented Feb 20, 2022

⌛ Testing commit 9763486 with merge 523a1b1...

@bors
Copy link
Contributor

bors commented Feb 20, 2022

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

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Feb 20, 2022
@bors bors merged commit 523a1b1 into rust-lang:master Feb 20, 2022
@rustbot rustbot added this to the 1.61.0 milestone Feb 20, 2022
@Mark-Simulacrum Mark-Simulacrum deleted the drop-print-cfg branch February 20, 2022 21:55
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (523a1b1): comparison url.

Summary: This benchmark run did not return any relevant results.

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

@rustbot label: -perf-regression

@rustbot rustbot removed the perf-regression Performance regression. label Feb 20, 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-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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants