-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Stdlib] Make the comparison operatosr on concrete Int types transparent #18169
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
[Stdlib] Make the comparison operatosr on concrete Int types transparent #18169
Conversation
@swift-ci please smoke test |
@swift-ci please test Source Compatibility |
Should we do the others as well? |
@swift-ci please smoke test compiler performance |
@airspeedswift As far as I can see, expect for BinaryInteger.<(lhs: Self, rhs: Other) almost all comparison operators: <, >, <= and >= are tiny, non-recursive, functions which I think could be made transparent. I could try making all of them transparent. |
Exercise caution, though... One of the metrics we don't gather is the memory consumption while compiling the standard library itself. And it can grow significantly with more |
@moiseev I see. Thanks for the heads up Max. |
…Int types transparent. This makes all operators symmetric, and makes constant folding and unreachable code analysis more precise and consistent. <rdar://39516135>
0a43150
to
81fad3c
Compare
@swift-ci please smoke test |
@swift-ci please test Source Compatibility |
@swift-ci please smoke test compiler performance |
@moiseev @airspeedswift I have marked two more methods on concrete integer types as transparent. Now all comparison operators on concrete integer types are transparent. I checked the optimized SIL of these functions and they have about 5 to 10 lines of SIL instructions. Also, there do not seem to be any noticeable increase in the memory usage while compiling stdlib. |
Build comment file:Summary for master smoketestUnexpected test results, excluded stats for Kingfisher, ReactiveCocoa No regressions above thresholds Debugdebug briefRegressed (0)
Improved (0)
Unchanged (delta < 1.0% or delta < 100.0ms) (2)
debug detailedRegressed (0)
Improved (0)
Unchanged (delta < 1.0% or delta < 100.0ms) (23)
Releaserelease briefRegressed (0)
Improved (0)
Unchanged (delta < 1.0% or delta < 100.0ms) (2)
release detailedRegressed (0)
Improved (0)
Unchanged (delta < 1.0% or delta < 100.0ms) (23)
|
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.
@swift-ci please test Source Compatibility |
@swift-ci please test and merge |
@swift-ci Please Test and Merge |
This makes them symmetrical to (<) operators, and makes constant folding
and unreachable code analysis more precise and consistent.
rdar://39516135