-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Use br
instead of a conditional when switching on a constant boolean
#120650
Conversation
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
Use `br` instead of a conditional when switching on a constant boolean r? `@ghost`
☀️ Try build successful - checks-actions |
1 similar comment
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (14c7e36): comparison URL. Overall result: ✅ improvements - 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: 660.289s -> 662.794s (0.38%) |
b0be08c
to
ee1df1b
Compare
Lets try applying this to all discriminants, not only bools |
This comment has been minimized.
This comment has been minimized.
Use `br` instead of a conditional when switching on a constant boolean r? `@ghost`
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (e99adce): comparison URL. Overall result: ✅ improvements - 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: 659.551s -> 660.659s (0.17%) |
ee1df1b
to
6320790
Compare
r? compiler |
r? compiler |
Looks promising but I don't know enough about this to gauge if this has any subtle, undesirable side effects. r? compiler |
Use `br` instead of a conditional when switching on a constant boolean r? `@ghost`
This comment has been minimized.
This comment has been minimized.
💔 Test failed - checks-actions |
@bors r- pub fn main() {
match -1 { -1 => {}, _ => panic!("wat") }
assert_eq!(1-1, 0);
} This test fails on the first match, and codegens to a branch directly to the panic. Looking into it |
15dad2b
to
469e6e5
Compare
Looks like |
469e6e5
to
7159aed
Compare
o7 |
🌲 The tree is currently closed for pull requests below priority 50. This pull request will be tested once the tree is reopened. |
☀️ Test successful - checks-actions |
Finished benchmarking commit (89d8e31): 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: 650.564s -> 651.95s (0.21%) |
CopyProp: Propagate moves of constants Yet another try of rust-lang#120650 - this time, keep track of SSA locals with a constant value and propagate it. Then, re-run `SimplifyConstCondition` to take advantage of it (simply reordering the pass regressed some tests). r? `@ghost`
r? @ghost