File tree 2 files changed +22
-1
lines changed 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -91,7 +91,7 @@ Inserter::shouldInsertMarkersForInstruction(SILInstruction *inst) {
91
91
BuiltinValueKind::StartAsyncLetWithLocalBuffer ||
92
92
bi->getBuiltinKind () == BuiltinValueKind::StartAsyncLet)
93
93
return Inserter::FindResult::Unhandleable;
94
- return Inserter::FindResult::None ;
94
+ LLVM_FALLTHROUGH ;
95
95
}
96
96
default :
97
97
return inst->mayRequirePackMetadata () ? FindResult::Some : FindResult::None;
Original file line number Diff line number Diff line change @@ -1318,6 +1318,27 @@ bool SILInstruction::mayRequirePackMetadata() const {
1318
1318
return ty->hasAnyPack ();
1319
1319
}
1320
1320
default :
1321
+ // Instructions that deallocate stack must not result in pack metadata
1322
+ // materialization. If they did there would be no way to create the pack
1323
+ // metadata on stack.
1324
+ if (isDeallocatingStack ())
1325
+ return false ;
1326
+
1327
+ // Check results and operands for packs. If a pack appears, lowering the
1328
+ // instruction might result in pack metadata emission.
1329
+ for (auto result : getResults ()) {
1330
+ if (result->getType ().hasAnyPack ())
1331
+ return true ;
1332
+ }
1333
+ for (auto operandTy : getOperandTypes ()) {
1334
+ if (operandTy.hasAnyPack ())
1335
+ return true ;
1336
+ }
1337
+ for (auto &tdo : getTypeDependentOperands ()) {
1338
+ if (tdo.get ()->getType ().hasAnyPack ())
1339
+ return true ;
1340
+ }
1341
+
1321
1342
return false ;
1322
1343
}
1323
1344
}
You can’t perform that action at this time.
0 commit comments