@@ -139,7 +139,7 @@ void TypeInfo::callOutlinedCopy(IRGenFunction &IGF, Address dest, Address src,
139
139
SILType T, IsInitialization_t isInit,
140
140
IsTake_t isTake) const {
141
141
if (!T.hasLocalArchetype () &&
142
- !IGF.IGM . getOptions (). UseTypeLayoutValueHandling ) {
142
+ !IGF.outliningCanCallValueWitnesses () ) {
143
143
OutliningMetadataCollector collector (IGF);
144
144
if (T.hasArchetype ()) {
145
145
collectMetadataForOutlining (collector, T);
@@ -235,13 +235,13 @@ llvm::Constant *IRGenModule::getOrCreateOutlinedInitializeWithTakeFunction(
235
235
auto manglingBits = getTypeAndGenericSignatureForManglingOutlineFunction (T);
236
236
auto funcName =
237
237
IRGenMangler ().mangleOutlinedInitializeWithTakeFunction (manglingBits.first ,
238
- manglingBits.second );
238
+ manglingBits.second , collector. IGF . isPerformanceConstraint );
239
239
240
240
return getOrCreateOutlinedCopyAddrHelperFunction (
241
241
T, ti, collector, funcName,
242
242
[this ](IRGenFunction &IGF, Address dest, Address src, SILType T,
243
243
const TypeInfo &ti) {
244
- if (!IGF.IGM . getOptions (). UseTypeLayoutValueHandling ||
244
+ if (!IGF.outliningCanCallValueWitnesses () ||
245
245
T.hasArchetype () || !canUseValueWitnessForValueOp (*this , T)) {
246
246
ti.initializeWithTake (IGF, dest, src, T, true );
247
247
} else {
@@ -256,13 +256,13 @@ llvm::Constant *IRGenModule::getOrCreateOutlinedInitializeWithCopyFunction(
256
256
auto manglingBits = getTypeAndGenericSignatureForManglingOutlineFunction (T);
257
257
auto funcName =
258
258
IRGenMangler ().mangleOutlinedInitializeWithCopyFunction (manglingBits.first ,
259
- manglingBits.second );
259
+ manglingBits.second , collector. IGF . isPerformanceConstraint );
260
260
261
261
return getOrCreateOutlinedCopyAddrHelperFunction (
262
262
T, ti, collector, funcName,
263
263
[this ](IRGenFunction &IGF, Address dest, Address src, SILType T,
264
264
const TypeInfo &ti) {
265
- if (!IGF.IGM . getOptions (). UseTypeLayoutValueHandling ||
265
+ if (!IGF.outliningCanCallValueWitnesses () ||
266
266
T.hasArchetype () || !canUseValueWitnessForValueOp (*this , T)) {
267
267
ti.initializeWithCopy (IGF, dest, src, T, true );
268
268
} else {
@@ -277,13 +277,13 @@ llvm::Constant *IRGenModule::getOrCreateOutlinedAssignWithTakeFunction(
277
277
auto manglingBits = getTypeAndGenericSignatureForManglingOutlineFunction (T);
278
278
auto funcName =
279
279
IRGenMangler ().mangleOutlinedAssignWithTakeFunction (manglingBits.first ,
280
- manglingBits.second );
280
+ manglingBits.second , collector. IGF . isPerformanceConstraint );
281
281
282
282
return getOrCreateOutlinedCopyAddrHelperFunction (
283
283
T, ti, collector, funcName,
284
284
[this ](IRGenFunction &IGF, Address dest, Address src, SILType T,
285
285
const TypeInfo &ti) {
286
- if (!IGF.IGM . getOptions (). UseTypeLayoutValueHandling ||
286
+ if (!IGF.outliningCanCallValueWitnesses () ||
287
287
T.hasArchetype () || !canUseValueWitnessForValueOp (*this , T)) {
288
288
ti.assignWithTake (IGF, dest, src, T, true );
289
289
} else {
@@ -298,13 +298,13 @@ llvm::Constant *IRGenModule::getOrCreateOutlinedAssignWithCopyFunction(
298
298
auto manglingBits = getTypeAndGenericSignatureForManglingOutlineFunction (T);
299
299
auto funcName =
300
300
IRGenMangler ().mangleOutlinedAssignWithCopyFunction (manglingBits.first ,
301
- manglingBits.second );
301
+ manglingBits.second , collector. IGF . isPerformanceConstraint );
302
302
303
303
return getOrCreateOutlinedCopyAddrHelperFunction (
304
304
T, ti, collector, funcName,
305
305
[this ](IRGenFunction &IGF, Address dest, Address src, SILType T,
306
306
const TypeInfo &ti) {
307
- if (!IGF.IGM . getOptions (). UseTypeLayoutValueHandling ||
307
+ if (!IGF.outliningCanCallValueWitnesses () ||
308
308
T.hasArchetype () || !canUseValueWitnessForValueOp (*this , T)) {
309
309
ti.assignWithCopy (IGF, dest, src, T, true );
310
310
} else {
@@ -334,7 +334,9 @@ llvm::Constant *IRGenModule::getOrCreateOutlinedCopyAddrHelperFunction(
334
334
generator (IGF, dest, src, T, ti);
335
335
IGF.Builder .CreateRet (dest.getAddress ());
336
336
},
337
- true /* setIsNoInline*/ );
337
+ true /* setIsNoInline*/ ,
338
+ false /* forPrologue*/ ,
339
+ collector.IGF .isPerformanceConstraint );
338
340
}
339
341
340
342
void TypeInfo::callOutlinedDestroy (IRGenFunction &IGF,
@@ -344,7 +346,7 @@ void TypeInfo::callOutlinedDestroy(IRGenFunction &IGF,
344
346
return ;
345
347
346
348
if (!T.hasLocalArchetype () &&
347
- !IGF.IGM . getOptions (). UseTypeLayoutValueHandling ) {
349
+ !IGF.outliningCanCallValueWitnesses () ) {
348
350
OutliningMetadataCollector collector (IGF);
349
351
if (T.hasArchetype ()) {
350
352
collectMetadataForOutlining (collector, T);
@@ -385,7 +387,7 @@ llvm::Constant *IRGenModule::getOrCreateOutlinedDestroyFunction(
385
387
IRGenMangler mangler;
386
388
auto manglingBits = getTypeAndGenericSignatureForManglingOutlineFunction (T);
387
389
auto funcName = mangler.mangleOutlinedDestroyFunction (manglingBits.first ,
388
- manglingBits.second );
390
+ manglingBits.second , collector. IGF . isPerformanceConstraint );
389
391
390
392
auto ptrTy = ti.getStorageType ()->getPointerTo ();
391
393
llvm::SmallVector<llvm::Type *, 4 > paramTys;
@@ -397,7 +399,7 @@ llvm::Constant *IRGenModule::getOrCreateOutlinedDestroyFunction(
397
399
Explosion params = IGF.collectParameters ();
398
400
Address addr = ti.getAddressForPointer (params.claimNext ());
399
401
collector.bindMetadataParameters (IGF, params);
400
- if (!IGF.IGM . getOptions (). UseTypeLayoutValueHandling ||
402
+ if (!IGF.outliningCanCallValueWitnesses () ||
401
403
T.hasArchetype () || !canUseValueWitnessForValueOp (*this , T)) {
402
404
ti.destroy (IGF, addr, T, true );
403
405
} else {
@@ -406,7 +408,9 @@ llvm::Constant *IRGenModule::getOrCreateOutlinedDestroyFunction(
406
408
407
409
IGF.Builder .CreateRet (addr.getAddress ());
408
410
},
409
- true /* setIsNoInline*/ );
411
+ true /* setIsNoInline*/ ,
412
+ false /* forPrologue*/ ,
413
+ collector.IGF .isPerformanceConstraint );
410
414
}
411
415
412
416
llvm::Constant *IRGenModule::getOrCreateRetainFunction (const TypeInfo &ti,
0 commit comments