@@ -156,59 +156,38 @@ struct UseDefChainVisitor
156
156
isMerge = true ;
157
157
break ;
158
158
case ProjectionKind::Enum: {
159
- // Enum is never a merge since it always has a single tuple field... but
160
- // it can be actor isolated.
161
- if (!bool (actorIsolation)) {
162
- auto *uedi = cast<UncheckedTakeEnumDataAddrInst>(inst);
163
- auto i = getActorIsolation (uedi->getEnumDecl ());
164
- // If our operand decl is actor isolated, then we want to stop looking
165
- // through since it is Sendable.
166
- if (i.isActorIsolated ()) {
167
- actorIsolation = i;
168
- return SILValue ();
169
- }
170
- }
159
+ auto op = cast<UncheckedTakeEnumDataAddrInst>(inst)->getOperand ();
160
+
161
+ // See if our operand type is a sendable type. In such a case, we do not
162
+ // want to look through our operand.
163
+ if (!isNonSendableType (op->getType (), op->getFunction ()))
164
+ return SILValue ();
165
+
171
166
break ;
172
167
}
173
168
case ProjectionKind::Tuple: {
174
169
// These are merges if we have multiple fields.
175
- auto *tti = cast<TupleElementAddrInst>(inst);
170
+ auto op = cast<TupleElementAddrInst>(inst)-> getOperand ( );
176
171
177
- // See if our result type is a sendable type. In such a case, we do not
178
- // want to look through the tuple_element_addr since we do not want to
179
- // identify the sendable type with the non-sendable operand. These we
180
- // are always going to ignore anyways since a sendable let/var field of
181
- // a struct can always be used.
182
- if (!isNonSendableType (tti->getType (), tti->getFunction ()))
172
+ if (!isNonSendableType (op->getType (), op->getFunction ()))
183
173
return SILValue ();
184
174
185
- isMerge |= tti-> getOperand () ->getType ().getNumTupleElements () > 1 ;
175
+ isMerge |= op ->getType ().getNumTupleElements () > 1 ;
186
176
break ;
187
177
}
188
178
case ProjectionKind::Struct:
189
- auto *sea = cast<StructElementAddrInst>(inst);
190
-
191
- // See if our type is actor isolated.
192
- if (!bool (actorIsolation)) {
193
- auto i = getActorIsolation (sea->getStructDecl ());
194
- // If our parent type is actor isolated then we do not want to keep on
195
- // walking up from use->def since the value is considered Sendable.
196
- if (i.isActorIsolated ()) {
197
- actorIsolation = i;
198
- return SILValue ();
199
- }
200
- }
179
+ auto op = cast<StructElementAddrInst>(inst)->getOperand ();
201
180
202
181
// See if our result type is a sendable type. In such a case, we do not
203
182
// want to look through the struct_element_addr since we do not want to
204
183
// identify the sendable type with the non-sendable operand. These we
205
184
// are always going to ignore anyways since a sendable let/var field of
206
185
// a struct can always be used.
207
- if (!isNonSendableType (sea ->getType (), sea ->getFunction ()))
186
+ if (!isNonSendableType (op ->getType (), op ->getFunction ()))
208
187
return SILValue ();
209
188
210
189
// These are merges if we have multiple fields.
211
- isMerge |= sea-> getOperand () ->getType ().getNumNominalFields () > 1 ;
190
+ isMerge |= op ->getType ().getNumNominalFields () > 1 ;
212
191
break ;
213
192
}
214
193
}
@@ -1457,6 +1436,8 @@ class PartitionOpTranslator {
1457
1436
LLVM_DEBUG (llvm::dbgs () << " %%" << state->getID () << " : " ;
1458
1437
state->print (llvm::dbgs ()); llvm::dbgs () << *arg);
1459
1438
nonSendableJoinedIndices.push_back (state->getID ());
1439
+ } else {
1440
+ LLVM_DEBUG (llvm::dbgs () << " Sendable: " << *arg);
1460
1441
}
1461
1442
}
1462
1443
0 commit comments