-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Peephole optimize x == false
and x != true
#86107
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
Conversation
(rust-highfive has picked a reviewer for you, use r? to override) |
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 2f1c219 with merge e2c32a71d8e2919c91fcde05b55ff8c486a9cdc2... |
r? @wesleywiser |
☀️ Try build successful - checks-actions |
Queued e2c32a71d8e2919c91fcde05b55ff8c486a9cdc2 with parent e4a6032, future comparison URL. |
Finished benchmarking try commit (e2c32a71d8e2919c91fcde05b55ff8c486a9cdc2): comparison url. Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. Please note that if the perf results are neutral, you should likely undo the rollup=never given below by specifying Importantly, though, if the results of this run are non-neutral do not roll this PR up -- it will mask other regressions or improvements in the roll up. @bors rollup=never |
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.
Looks great!
@bors r+ |
📌 Commit 2f1c219 has been approved by |
☀️ Test successful - checks-actions |
This adds peephole optimizations to make
x == false
,false == x
,x != true
, andtrue != x
get optimized to!x
in theinstcombine
MIR pass. That pass currently handlesx == true
->x
already.