-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Rename UninhabitedEnumBranching
to UnreachableEnumBranching
#122225
Conversation
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
Thanks for the PR! However, unfortunately I can't review any behavior change in a MIR opt, nor can I tell whether the new tests make sense. |
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
Rename `UninhabitedEnumBranching` to `UnreachableEnumBranching` Per [rust-lang#120268](rust-lang#120268 (comment)), I rename `UninhabitedEnumBranching` to `UnreachableEnumBranching` . I solved some nits to add some comments. I adjusted the workaround restrictions. This should be useful for `a <= b` and `if let Some/Ok(v)`. For enum with few variants, `early-tailduplication` should not cause compile time overhead. r? RalfJung
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (ba9e2ee): comparison URL. Overall result: ❌ regressions - no action neededBenchmarking 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 Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis 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.
CyclesResultsThis 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.
Binary sizeResultsThis 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.
Bootstrap: 650.585s -> 649.35s (-0.19%) |
@cjgillot Would you be willing to add yourself to |
let replace_otherwise_to_unreachable = otherwise_is_last_variant | ||
|| !otherwise_is_empty_unreachable && allowed_variants.is_empty(); | ||
|| (!otherwise_is_empty_unreachable && allowed_variants.is_empty()); | ||
|
||
if unreachable_targets.is_empty() && !replace_otherwise_to_unreachable { | ||
continue; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The allow(rustc::potential_query_instability)
should include a comment that the length of the list is known to be 1. Or use one of the exactly_one iterator adapaters.
…` or `Result` `early-tailduplication` is only a problem when there are a significant number of branches.
@bors r+ |
☀️ Test successful - checks-actions |
Finished benchmarking commit (76cf07d): comparison URL. Overall result: ✅ improvements - no action needed@rustbot label: -perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis 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.
CyclesResultsThis 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.
Binary sizeResultsThis 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.
Bootstrap: 667.614s -> 668.678s (0.16%) |
Per #120268, I rename
UninhabitedEnumBranching
toUnreachableEnumBranching
.I solved some nits to add some comments.
I adjusted the workaround restrictions. This should be useful for
a <= b
andif let Some/Ok(v)
. For enum with few variants,early-tailduplication
should not cause compile time overhead.r? RalfJung