-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Refactor FixedWidthInteger init #36485
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
|
@swift-ci benchmark |
Performance: -O
Code size: -OPerformance: -Osize
Code size: -OsizePerformance: -Onone
Code size: -swiftlibsHow to read the dataThe tables contain differences in performance which are larger than 8% and differences in code size which are larger than 1%.If you see any unexpected regressions, you should consider fixing the Noise: Sometimes the performance results (not code size!) contain false Hardware Overview |
3a0b7f0 to
0e5d73d
Compare
|
@swift-ci test |
|
Build failed |
| } | ||
|
|
||
| @_alwaysEmitIntoClient | ||
| internal static func _truncatingInit<T: BinaryInteger>(_ source: T) -> Self { |
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.
Clarify if @_alwaysEmitIntoClient is fine to use here
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.
It looks fine to me from an ABI compatibility viewpoint! 👍
|
@swift-ci test Linux platform |
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.
LGTM
Someone from the stdlib, @lorentey ? could do a quick sanity check.
I don't think this is a temporary workaround at all. I think it fixes an underlying compile-time and code size problem that jump-threading was somewhat hiding from us. Running jump-threading doesn't change the fact that the compiler is generating a giant CFG to begin with.
|
@lorentey can you please take a look ? |
|
@swift-ci test Linux platform |
Without jump threading enabled in ossa, the FixedWidthInteger's init function which is an inline always function causes large cfgs due to the truncation case. This PR separates the truncation case into a different function with no always inlining.