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

MIR: Stop needing an explicit BB for otherwise:unreachable #124188

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

scottmcm
Copy link
Member

So many places to update :D

Zulip conversation: https://rust-lang.zulipchat.com/#narrow/stream/189540-t-compiler.2Fwg-mir-opt/topic/Pondering.20the.20SwitchInt.20.26.20unreachable/near/432988457

For this PR I tried to keep things doing essentially the same thing as before. No new passes to try to use it more, no change to MIR building for exhaustive matches, etc.

That said, UnreachableProp still picks it up, and thus there's still a bunch of otherwise arms removed and unreachable blocks that no longer show.

r? ghost
cc @JakobDegen @saethlin @cuviper @wesleywiser

@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 Apr 20, 2024

let terminator = match (num_targets, otherwise_unreachable) {
// If all targets are unreachable, we can be unreachable as well.
(1, true) => TerminatorKind::Unreachable,
Copy link
Member Author

Choose a reason for hiding this comment

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

This whole section I couldn't find a simple update, so please check the new logic carefully.

@rust-log-analyzer

This comment has been minimized.

@scottmcm scottmcm force-pushed the implicit-switchint-unreachable branch from cb1df69 to a1cd814 Compare April 20, 2024 04:56
@rust-log-analyzer

This comment has been minimized.

@scottmcm scottmcm force-pushed the implicit-switchint-unreachable branch from a1cd814 to acc7f0d Compare April 20, 2024 05:58
@scottmcm
Copy link
Member Author

@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 Apr 20, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 20, 2024
…ble, r=<try>

MIR: Stop needing an explicit BB for `otherwise:unreachable`

So many places to update :D

Zulip conversation: <https://rust-lang.zulipchat.com/#narrow/stream/189540-t-compiler.2Fwg-mir-opt/topic/Pondering.20the.20SwitchInt.20.26.20unreachable/near/432988457>

For this PR I tried to keep things doing essentially the same thing as before.  No new passes to try to use it more, no change to MIR building for exhaustive matches, etc.

That said, `UnreachableProp` still picks it up, and thus there's still a bunch of `otherwise` arms removed and `unreachable` blocks that no longer show.

r? ghost
cc `@JakobDegen` `@saethlin` `@cuviper` `@wesleywiser`
@bors
Copy link
Contributor

bors commented Apr 20, 2024

⌛ Trying commit acc7f0d with merge d8f8976...

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Apr 20, 2024

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

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (d8f8976): comparison URL.

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

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-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.6% [0.2%, 1.0%] 6
Regressions ❌
(secondary)
2.7% [1.7%, 5.2%] 8
Improvements ✅
(primary)
-0.8% [-0.8%, -0.8%] 1
Improvements ✅
(secondary)
-0.9% [-1.3%, -0.7%] 3
All ❌✅ (primary) 0.4% [-0.8%, 1.0%] 7

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)
3.0% [0.1%, 6.0%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-2.2% [-3.7%, -0.8%] 3
Improvements ✅
(secondary)
-2.7% [-2.7%, -2.7%] 1
All ❌✅ (primary) -0.1% [-3.7%, 6.0%] 5

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.4% [1.0%, 3.1%] 11
Regressions ❌
(secondary)
3.9% [0.9%, 7.0%] 5
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.0% [-2.0%, -2.0%] 1
All ❌✅ (primary) 2.4% [1.0%, 3.1%] 11

Binary size

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.4% [0.1%, 1.9%] 57
Regressions ❌
(secondary)
1.6% [0.1%, 5.3%] 15
Improvements ✅
(primary)
-0.2% [-1.2%, -0.0%] 22
Improvements ✅
(secondary)
-0.2% [-0.4%, -0.0%] 8
All ❌✅ (primary) 0.2% [-1.2%, 1.9%] 79

Bootstrap: 670.134s -> 670.046s (-0.01%)
Artifact size: 315.30 MiB -> 315.35 MiB (0.02%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Apr 20, 2024
@scottmcm scottmcm force-pushed the implicit-switchint-unreachable branch from acc7f0d to beb9ce0 Compare April 20, 2024 14:22
@bors
Copy link
Contributor

bors commented May 24, 2024

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

@Dylan-DPC Dylan-DPC added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 15, 2024
@Dylan-DPC
Copy link
Member

@scottmcm any updates on this? thanks

So many places to update :D

For this PR I tried to keep things doing essentially the same thing as before.  No new passes to try to use it more, no change to MIR building for exhaustive matches, etc.

That said, `UnreachableProp` still picks it up, and thus there's still a bunch of `otherwise` arms removed and `unreachable` blocks that no longer show.
@scottmcm scottmcm force-pushed the implicit-switchint-unreachable branch from beb9ce0 to f6d0f73 Compare January 6, 2025 09:43
@scottmcm
Copy link
Member Author

scottmcm commented Jan 7, 2025

@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 Jan 7, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 7, 2025
…ble, r=<try>

MIR: Stop needing an explicit BB for `otherwise:unreachable`

So many places to update :D

Zulip conversation: <https://rust-lang.zulipchat.com/#narrow/stream/189540-t-compiler.2Fwg-mir-opt/topic/Pondering.20the.20SwitchInt.20.26.20unreachable/near/432988457>

For this PR I tried to keep things doing essentially the same thing as before.  No new passes to try to use it more, no change to MIR building for exhaustive matches, etc.

That said, `UnreachableProp` still picks it up, and thus there's still a bunch of `otherwise` arms removed and `unreachable` blocks that no longer show.

r? ghost
cc `@JakobDegen` `@saethlin` `@cuviper` `@wesleywiser`
@bors
Copy link
Contributor

bors commented Jan 7, 2025

⌛ Trying commit f6d0f73 with merge 5ed2b42...

@bors
Copy link
Contributor

bors commented Jan 7, 2025

☀️ Try build successful - checks-actions
Build commit: 5ed2b42 (5ed2b4240c073e252a4ea1aed240628cbb282f5e)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (5ed2b42): comparison URL.

Overall result: ❌✅ regressions and improvements - please read the text below

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.

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-perf +perf-regression

Instruction count

This is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.

mean range count
Regressions ❌
(primary)
0.6% [0.4%, 0.7%] 3
Regressions ❌
(secondary)
0.6% [0.2%, 1.0%] 10
Improvements ✅
(primary)
-0.2% [-0.2%, -0.2%] 1
Improvements ✅
(secondary)
-0.3% [-0.3%, -0.2%] 5
All ❌✅ (primary) 0.4% [-0.2%, 0.7%] 4

Max RSS (memory usage)

Results (primary 1.1%, secondary -0.2%)

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)
4.7% [1.3%, 7.8%] 6
Regressions ❌
(secondary)
2.2% [2.0%, 2.7%] 3
Improvements ✅
(primary)
-4.4% [-5.8%, -2.6%] 4
Improvements ✅
(secondary)
-2.6% [-2.8%, -2.3%] 3
All ❌✅ (primary) 1.1% [-5.8%, 7.8%] 10

Cycles

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

Binary size

Results (primary -0.0%, secondary 0.4%)

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.2% [0.0%, 0.9%] 16
Regressions ❌
(secondary)
3.3% [0.0%, 6.5%] 2
Improvements ✅
(primary)
-0.1% [-0.5%, -0.0%] 33
Improvements ✅
(secondary)
-0.2% [-0.5%, -0.0%] 11
All ❌✅ (primary) -0.0% [-0.5%, 0.9%] 49

Bootstrap: 763.24s -> 762.548s (-0.09%)
Artifact size: 325.59 MiB -> 324.97 MiB (-0.19%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
perf-regression Performance regression. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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