[semantic-arc] In SILGen always assign a copy_value's argument to its result. #5661
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This ensures that ownership is properly propagated forward through the use-def
graph.
This was the work that was stymied by issues relating to SILBuilder performing local ARC dataflow. I ripped out that local dataflow in 6f4e2ab and added a cheap ARC guaranteed dataflow pass that performs the same optimization.
Also in the process of doing this work, I found that there were many SILGen tests that were either pattern matching in the wrong functions or had wrong CHECK lines (for instance CHECK_NEXT). I fixed all of these issues and also expanded many of the tests so that they verify ownership. The only work I left for a future PR is that there are certain places in tests where we are using the projection from an original value, instead of a copy. I marked those with a message SEMANTIC ARC TODO so that they are easy to find.
rdar://28685236