[owned-phiweb-elimination] Add an "ApplySite" like wrapper for OwnershipIntroducingValues and add utilities for finding them. #30265
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.
An OwnershipIntroducingValue is a value with owned ownership that is not a result of forwarding ownership from some other value. It is similar to the notion of "rc identity" that we talk about in the low level ARC optimizer.
I am adding this support so given a specific value, we can walk up the def-use graph and find all of the ownership introducing values (what one would call in the low level ARC optimizer an "rc identity set"). As an example, consider the following SIL:
In this case, the set of ownership introducing values for
%3
would be (%0, %1).In order to implement phi elimination, I need to be able to ascertain all of the owned value introducers for a specific incoming value so I can see if I can convert all of the LiveRanges associated with the incoming value could be converted to guaranteed if we could flip the phi argument.