[region-isolation] Begin tracking in SILIsolationInfo the actorInstance that a value is isolated to if we are dealing with an actor instance.

This will let us distinguish in between values derived from two actor instances
of the same type and to emit better errors.
This commit is contained in:
Michael Gottesman
2024-04-10 14:58:59 -07:00
parent eed51e7528
commit d8f39f70d9
3 changed files with 79 additions and 38 deletions

View File

@@ -3281,8 +3281,11 @@ TrackableValue RegionAnalysisValueMap::getTrackableValue(
// If we were able to find this was actor isolated from finding our
// underlying object, use that. It is never wrong.
if (info.actorIsolation) {
SILValue actorInstance =
info.value->getType().isActor() ? info.value : SILValue();
iter.first->getSecond().mergeIsolationRegionInfo(
SILIsolationInfo::getActorIsolated(value, *info.actorIsolation));
SILIsolationInfo::getActorIsolated(value, actorInstance,
*info.actorIsolation));
}
auto storage = AccessStorageWithBase::compute(value);
@@ -3332,7 +3335,7 @@ TrackableValue RegionAnalysisValueMap::getTrackableValue(
auto parentAddrInfo = getUnderlyingTrackedValue(svi);
if (parentAddrInfo.actorIsolation) {
iter.first->getSecond().mergeIsolationRegionInfo(
SILIsolationInfo::getActorIsolated(svi,
SILIsolationInfo::getActorIsolated(svi, parentAddrInfo.value,
*parentAddrInfo.actorIsolation));
}