Skip to content

Commit f7d1f2a

Browse files
committed
[region-isolation] Define getIsolationRegionInfo(Element elt) on PartitionOpEvaluator.
This will let me look up the dynamic isolation region associated with \p elt while performing dataflow.
1 parent b23b791 commit f7d1f2a

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

include/swift/SILOptimizer/Utils/PartitionUtils.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1220,6 +1220,10 @@ struct PartitionOpEvaluator {
12201220
return asImpl().isActorDerived(elt);
12211221
}
12221222

1223+
ValueIsolationRegionInfo getIsolationRegionInfo(Element elt) const {
1224+
return asImpl().getIsolationRegionInfo(elt);
1225+
}
1226+
12231227
bool isTaskIsolatedDerived(Element elt) const {
12241228
return asImpl().isTaskIsolatedDerived(elt);
12251229
}
@@ -1429,6 +1433,12 @@ struct PartitionOpEvaluatorBaseImpl : PartitionOpEvaluator<Subclass> {
14291433
/// isolated value.
14301434
bool isTaskIsolatedDerived(Element elt) const { return false; }
14311435

1436+
/// Returns the information about \p elt's isolation that we ascertained from
1437+
/// SIL and the AST.
1438+
ValueIsolationRegionInfo getIsolationRegionInfo(Element elt) const {
1439+
return ValueIsolationRegionInfo();
1440+
}
1441+
14321442
/// Check if the representative value of \p elt is closure captured at \p
14331443
/// op.
14341444
///

lib/SILOptimizer/Mandatory/TransferNonSendable.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1355,6 +1355,10 @@ struct DiagnosticEvaluator final
13551355
return info->getValueMap().getIsolationRegion(element).getKind();
13561356
}
13571357

1358+
ValueIsolationRegionInfo getIsolationRegionInfo(Element element) const {
1359+
return info->getValueMap().getIsolationRegion(element);
1360+
}
1361+
13581362
bool isClosureCaptured(Element element, Operand *op) const {
13591363
auto value = info->getValueMap().maybeGetRepresentative(element);
13601364
if (!value)

0 commit comments

Comments
 (0)