[6.0][region-isolation] Reuse ActorInstance::lookThroughInsts when computing the actor instance for SILIsolationInfo purposes. #75044
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.
Explanation: This PR improves our ability to properly unify actor instances by standardizing region isolation to use the same ActorInstance::lookThroughInsts in both RegionAnalysis and SILIsolationInfo inference. The result is that cases like the following compile since we are able to ensure that all of the #isolation parameters are viewed as having the same isolation as the ambient isolation in callers:
Before we would view them as different and upon isolation merges would hit merge failures (since a region cannot have two values within the region that are actor isolated to different actors). This merge failure would then cause us to emit a "pattern compiler doesn't understand" error at taskGroup.waitForAll().
Radars:
Original PRs:
Risk: Low. This allows the compiler to view more actor instances as the same in a very conservative way since we just look through instructions that propagate the same actor identity (e.x.: copy_value, move_value, init_existential_ref, optional formation). If looking through these instructions caused any issue, it would show a differing significant issue in the compiler that would be a separate error.
Testing: Added/Ran tests
Reviewer: N/A