@@ -1229,11 +1229,14 @@ struct PartitionOpEvaluator {
1229
1229
// case, if we are not marked explicitly as sending, we do not transfer
1230
1230
// since the disconnected value is allowed to be resued after we
1231
1231
// return. If we are passed as a sending parameter, we cannot do this.
1232
- if (auto fas = FullApplySite::isa (op.getSourceInst ());
1233
- (!fas || !fas.isSending (*op.getSourceOp ())) &&
1234
- transferredRegionIsolation.isDisconnected () && calleeIsolationInfo &&
1235
- transferredRegionIsolation.hasSameIsolation (calleeIsolationInfo))
1236
- return ;
1232
+ if (auto *sourceInst = Impl::getSourceInst (op)) {
1233
+ if (auto fas = FullApplySite::isa (sourceInst);
1234
+ (!fas || !fas.isSending (*op.getSourceOp ())) &&
1235
+ transferredRegionIsolation.isDisconnected () &&
1236
+ calleeIsolationInfo &&
1237
+ transferredRegionIsolation.hasSameIsolation (calleeIsolationInfo))
1238
+ return ;
1239
+ }
1237
1240
1238
1241
// Mark op.getOpArgs()[0] as transferred.
1239
1242
TransferringOperandState &state = operandToStateMap.get (op.getSourceOp ());
@@ -1581,6 +1584,9 @@ struct PartitionOpEvaluatorBaseImpl : PartitionOpEvaluator<Subclass> {
1581
1584
1582
1585
static SILLocation getLoc (SILInstruction *inst) { return inst->getLoc (); }
1583
1586
static SILLocation getLoc (Operand *op) { return op->getUser ()->getLoc (); }
1587
+ static SILInstruction *getSourceInst (const PartitionOp &partitionOp) {
1588
+ return partitionOp.getSourceInst ();
1589
+ }
1584
1590
static SILIsolationInfo getIsolationInfo (const PartitionOp &partitionOp) {
1585
1591
return SILIsolationInfo::get (partitionOp.getSourceInst ());
1586
1592
}
0 commit comments