-
Notifications
You must be signed in to change notification settings - Fork 274
Simplify (T)(a?b:c) to a?(T)b:(T)c #5892
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
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.
I am a little concerned about the cost of this, esp. w.r.t. non-trivial casts like double
->float
or int
->double
. Some things like integer reduction are definitely worth doing. Is it worth restricting what types this is applied to?
Codecov ReportBase: 78.02% // Head: 78.04% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## develop #5892 +/- ##
===========================================
+ Coverage 78.02% 78.04% +0.02%
===========================================
Files 1625 1624 -1
Lines 187427 187431 +4
===========================================
+ Hits 146231 146274 +43
+ Misses 41196 41157 -39
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. |
6b7d8c9
to
8599eaf
Compare
Done. |
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.
I think that will avoid the most expensive cases. Thanks.
8599eaf
to
d98c756
Compare
d98c756
to
7a4c06e
Compare
Do we have any means to performance-benchmark? |
7a4c06e
to
e9a4cb4
Compare
I have run all of SV-COMP's benchmarks on this branch and compared it to develop. No difference beyond the expected jitter was observable. Therefore, I'd argue that this simplification step can in some cases permit additional constant propagation without adversely affecting other verification tasks that don't contain such expressions. |
e9a4cb4
to
512f1ce
Compare
The idea of such a rule existed ever since 7285dda, but was possibly too costly when doing it post-order for one would have to re-process multiple sub-expressions. A pre-order rule avoids such repeat processing.
512f1ce
to
fac7964
Compare
The idea of such a rule existed ever since 7285dda, but was possibly too
costly when doing it post-order for one would have to re-process
multiple sub-expressions. A pre-order rule avoids such repeat
processing.