-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Update MutableSpan and OutputSpan #85481
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
Update MutableSpan and OutputSpan #85481
Conversation
|
Based on #85476 |
53d9e6e to
0d0c1d5
Compare
|
@swift-ci test |
0d0c1d5 to
1d6440e
Compare
|
I'll just trust that the fixed_storage If @glessard thinks it's worth adding new entry points in the stdlib to work around optimization barriers, then I won't object. My primary concern is that we're avoiding fixing optimizer support for |
|
@atrick I can document the semantics as a follow on. They have been in use for Span and InlineArray.
Agree mark_dependence [nonescaping] is not handled well. But it didn't seem relevant for the tests whose bounds check optimizations were blocked in SIL due to the lack of semantics. @glessard I would like to merge the semantics and _assumeNonNegative changes at the very least. BitwiseCopyable specializations are useful too but it's fine to not merge. |
|
I agree with the semantics and |
|
@swift-ci please test |
| @_originallyDefinedIn(module: "Swift;CompatibilitySpan", SwiftCompatibilitySpan 6.2) | ||
| extension MutableSpan where Element: BitwiseCopyable { | ||
| @_alwaysEmitIntoClient | ||
| public subscript(_ position: Index) -> Element { |
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 would expect that these have to be @inline(always), if we're going to have them.
1d6440e to
c93163c
Compare
|
I removed the BitwiseCopyable specializations from this PR. |
|
@swift-ci test |
glessard
left a comment
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 @meg-gupta
MutableSpanandOutputSpanwith@_semantics. Span's subscript was already annotated with@_semanticsand doesn't need a similar change._assumeNonNegativefor OutputSpan's count