-
Notifications
You must be signed in to change notification settings - Fork 265
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
ITE and binary relations are constant when all operands are constants #7569
Conversation
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.
Does the same reasoning also apply to further operators such as bitwise and boolean operators?
Good call. Doing something like |
f926d2b
to
8f1677a
Compare
This expands the definition of is_constantt to cover if-then-else as well as binary relations and logic or bit operations. In many, but not, cases the simplifier will have turned these into simpler constants. The included regression test is derived from Rust code, where the intermediate representation (together with constant propagation) will yield such comparisons.
8f1677a
to
0289d31
Compare
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## develop #7569 +/- ##
===========================================
+ Coverage 78.39% 78.50% +0.10%
===========================================
Files 1670 1670
Lines 191760 191764 +4
===========================================
+ Hits 150337 150544 +207
+ Misses 41423 41220 -203
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
This expands the definition of is_constantt to cover if-then-else as well as binary relations. In many, but not, cases the simplifier will have turned these into simpler constants. The included regression test is derived from Rust code, where the intermediate representation (together with constant propagation) will yield such comparisons.