-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Add [nonatomic] attribute to all SIL reference counting instructions. #2067
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 Please smoke test Linux platform |
@swift-ci Please smoke test Linux platform |
1 similar comment
@swift-ci Please smoke test Linux platform |
@jckarter Joe, do you mind taking a look? This PR contains a lot of almost mechanical changes and boiler plate code to introduce the new
|
Please make the isAtomic flag an enum class : bool instead of a bare bool, either in IRGen.h or somewhere in AST/SIL. Do you really need to pass this to the in-memory operations? You're not doing anything in SIL that would allow IRGen to ever use anything except atomic refcounting for them. |
Sure. Good point!
I'm not sure I understand your question. Can you elaborate? My overall plan is that there will be a SIL optimization pass which marks some of SIL refcounting instructions as So far, I added this "isAtomic" flag to some APIs in a couple of IRGen base classes. As a result a bunch of classes derived from those had to be adjusted as well to add this additional parameter to their corresponding derived functions. Do you mean that I changed too many classes in IRGen and some of those changes could be avoided, because they are not necessary? |
I mean that you've changed the SIL ref-counting operations (retain, release, etc.), but not the SIL memory access operations (load, store, copy_addr, destroy_addr); and yet you've added the isAtomic flag to all the IRGen load/store operations. |
Based on @rjmccall's comment, I introduced a In the next update, I'm going to address the comment about the in-memory operations. |
@swift-ci Please smoke test Linux platform |
Looks good. |
@rjmccall I removed the atomicity flag from But
So, I guess |
@swift-ci Please smoke test Linux platform |
That makes sense to me. |
@rjmccall OK. Thank for reviewing this PR, John! I'll test and merge. |
Properly lower reference counting SIL instructions with nonatomic attribute as invocations of corresponding non-atomic reference counting runtime functions.
@swift-ci Please smoke test |
What's in this pull request?
Add [nonatomic] attribute to all SIL reference counting instructions.
Support serialization/deserialization, printing and parsing of this attribute.
Update all affected places to explicitly use the new attribute.
THIS IS WORK IN PROGRESS. DO NOT MERGE YET.
Resolved bug number: (SR-249)
Before merging this pull request to apple/swift repository:
Triggering Swift CI
The swift-ci is triggered by writing a comment on this PR addressed to the GitHub user @swift-ci. Different tests will run depending on the specific comment that you use. The currently available comments are:
Smoke Testing
Validation Testing
Note: Only members of the Apple organization can trigger swift-ci.