-
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
Consider empty-unreachable otherwise branches in MatchBranchSimplification #131244
base: master
Are you sure you want to change the base?
Conversation
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
e7e8678
to
67c9f97
Compare
r? wg-mir-opt |
fn my_is_some(_1: &Option<T>) -> bool {
debug bar => _1;
let mut _0: bool;
let mut _2: isize;
bb0: {
_2 = discriminant((*_1));
switchInt(move _2) -> [1: bb2, otherwise: bb1]; // two-branch SwitchInt, not 3
}
bb1: {
_0 = const false;
goto -> bb3;
}
bb2: {
_0 = const true;
goto -> bb3;
}
bb3: {
return;
}
}
|
e6f54ee
to
ba723e6
Compare
- bb4: { | ||
+ StorageLive(_3); | ||
+ _3 = copy _2; | ||
+ _0 = Ne(copy _3, const 0_isize); |
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.
Custom MIR limitations meant I couldn't have the branches in the same order, so this creates an Ne instead (unlike an Eq like the original demo)
This comment has been minimized.
This comment has been minimized.
ba723e6
to
66edf31
Compare
This comment has been minimized.
This comment has been minimized.
66edf31
to
c0d609d
Compare
c0d609d
to
7cd33b8
Compare
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
…, r=<try> Consider empty-unreachable otherwise branches in MatchBranchSimplification Fixes rust-lang#131219
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (20e541a): comparison URL. Overall result: ❌✅ regressions and improvements - please read the text belowBenchmarking 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 @bors rollup=never Instruction countThis 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.
Max RSS (memory usage)Results (primary 4.7%, secondary -3.8%)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.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeResults (primary -0.0%, 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.
Bootstrap: 783.769s -> 780.785s (-0.38%) |
Fixes #131219