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

Separate const prop lints from optimizations #94934

Merged
merged 6 commits into from Mar 24, 2022

Conversation

Lireer
Copy link
Contributor

@Lireer Lireer commented Mar 14, 2022

r? @oli-obk

Separates lints and optimizations during const prop by moving the lints into their own file and checking them during post borrowck cleanup.
Thanks to @oli-obk for mentoring me.

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

@oli-obk oli-obk left a comment

Choose a reason for hiding this comment

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

If you write fixes #70073 merging this PR will automatically close that issue

src/test/ui/consts/promotion.rs Outdated Show resolved Hide resolved
@oli-obk
Copy link
Contributor

oli-obk commented Mar 14, 2022

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

bors commented Mar 14, 2022

⌛ Trying commit 449f1e18d211f9c0018d6f79cf1c02bb8110e776 with merge 11e53ca50fce06dbb1fa00ab5a78ee351b427888...

@Lireer
Copy link
Contributor Author

Lireer commented Mar 14, 2022

Some issues that might be affected by this PR #81265, #82646, #81224, #70923, #51491.

@tmiasko
Copy link
Contributor

tmiasko commented Mar 14, 2022

run_post_borrowck_cleanup_passes doesn't run for --emit metadata / cargo check, except for const fns. You might want to experiment with changing that as well:

if tcx.hir().body_const_context(def_id).is_some() {
tcx.ensure()
.mir_drops_elaborated_and_const_checked(ty::WithOptConstParam::unknown(def_id));
}

@tmiasko
Copy link
Contributor

tmiasko commented Mar 14, 2022

@rust-timer build 11e53ca50fce06dbb1fa00ab5a78ee351b427888

@rust-timer
Copy link
Collaborator

Queued 11e53ca50fce06dbb1fa00ab5a78ee351b427888 with parent 0ac4658, future comparison URL.

@oli-obk
Copy link
Contributor

oli-obk commented Mar 14, 2022

run_post_borrowck_cleanup_passes doesn't run for --emit metadata / cargo check, except for const fns. You might want to experiment with changing that as well:

if tcx.hir().body_const_context(def_id).is_some() {
tcx.ensure()
.mir_drops_elaborated_and_const_checked(ty::WithOptConstParam::unknown(def_id));
}

We could also try moving the lint even earlier. mir-interpret should be able to handle it with some minor tweaks to change panics into more benign failures

Edit: will address this in follow up PRs

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (11e53ca50fce06dbb1fa00ab5a78ee351b427888): comparison url.

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

  • Arithmetic mean of relevant regressions: 1.0%
  • Largest regression in instruction counts: 2.0% on incr-patched: println builds of unicode_normalization debug

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. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Mar 14, 2022
@oli-obk
Copy link
Contributor

oli-obk commented Mar 15, 2022

We're doing const prop twice now, so it's fairly obvious where the regression is coming from. This is expected, since the current PR is the first step to fix the bug that optimizations can change diagnostics.

@oli-obk
Copy link
Contributor

oli-obk commented Mar 15, 2022

@bors r+ rollup=never

@bors
Copy link
Contributor

bors commented Mar 15, 2022

📌 Commit da1a68326927f815a72347368352e2fa01c48e30 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 Mar 15, 2022
@bors
Copy link
Contributor

bors commented Mar 15, 2022

⌛ Testing commit da1a68326927f815a72347368352e2fa01c48e30 with merge 4976c2337559584555ca2e9567413e85218a0ad3...

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

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

bors commented Mar 18, 2022

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

@oli-obk
Copy link
Contributor

oli-obk commented Mar 24, 2022

@bors r+

@bors
Copy link
Contributor

bors commented Mar 24, 2022

💡 This pull request was already approved, no need to approve it again.

  • This pull request previously failed. You should add more commits to fix the bug, or use retry to trigger a build again.
  • There's another pull request that is currently being tested, blocking this pull request: Properly track ImplObligations #91030

@bors
Copy link
Contributor

bors commented Mar 24, 2022

📌 Commit 440946a 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 Mar 24, 2022
@bors
Copy link
Contributor

bors commented Mar 24, 2022

⌛ Testing commit 440946a with merge 903707951703c815ca0bf6432bdce20e0873acda...

@rust-log-analyzer
Copy link
Collaborator

A job failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)

@bors
Copy link
Contributor

bors commented Mar 24, 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 Mar 24, 2022
@oli-obk
Copy link
Contributor

oli-obk commented Mar 24, 2022

@bors retry failure near submodule checkouts

@bors
Copy link
Contributor

bors commented Mar 24, 2022

⌛ Testing commit 440946a with merge 63b8f01...

@bors
Copy link
Contributor

bors commented Mar 24, 2022

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

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

Finished benchmarking commit (63b8f01): comparison url.

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

  • Arithmetic mean of relevant regressions: 1.2%
  • Largest regression in instruction counts: 2.1% on incr-full builds of unicode_normalization opt

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

@oli-obk
Copy link
Contributor

oli-obk commented Mar 25, 2022

We're doing const prop twice now, so it's fairly obvious where the regression is coming from. This is expected, since the current PR is the first step to fix the bug that optimizations can change diagnostics.

@rustbot label: +perf-regression-triaged

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-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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants