-
Notifications
You must be signed in to change notification settings - Fork 777
OptimizeInstruction: Optimize any boolean & (No overlap with boolean's LSB) ==> 0 #7505
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
base: main
Are you sure you want to change the base?
Conversation
;; CHECK-NEXT: ) | ||
;; CHECK-NEXT: (i32.const 2) | ||
;; CHECK-NEXT: ) | ||
;; CHECK-NEXT: (i32.const 0) | ||
;; CHECK-NEXT: ) | ||
;; CHECK-NEXT: (drop | ||
;; CHECK-NEXT: (i32.eqz |
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.
We will need new tests for the new function optimizeAndNoOverlappingBits
, including the various corner cases (just one overlapping bit, no overlapping bits, etc.)
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.
Thanks for teaching, with your suggestions I've found many shortcomings in my PR code. Now, I've updated all.
There are so many rules for
and
, but we still cannot optimize the following one:to zero.
Adding rule for
add
:any boolean & (No overlap with boolean's LSB) ==> 0
Fixes: #7481