@@ -139,7 +139,7 @@ void TypeInfo::callOutlinedCopy(IRGenFunction &IGF, Address dest, Address src,
139139 SILType T, IsInitialization_t isInit,
140140 IsTake_t isTake) const {
141141 if (!T.hasLocalArchetype () &&
142- !IGF.IGM . getOptions (). UseTypeLayoutValueHandling ) {
142+ !IGF.outliningCanCallValueWitnesses () ) {
143143 OutliningMetadataCollector collector (IGF);
144144 if (T.hasArchetype ()) {
145145 collectMetadataForOutlining (collector, T);
@@ -235,13 +235,13 @@ llvm::Constant *IRGenModule::getOrCreateOutlinedInitializeWithTakeFunction(
235235 auto manglingBits = getTypeAndGenericSignatureForManglingOutlineFunction (T);
236236 auto funcName =
237237 IRGenMangler ().mangleOutlinedInitializeWithTakeFunction (manglingBits.first ,
238- manglingBits.second );
238+ manglingBits.second , collector. IGF . isPerformanceConstraint );
239239
240240 return getOrCreateOutlinedCopyAddrHelperFunction (
241241 T, ti, collector, funcName,
242242 [this ](IRGenFunction &IGF, Address dest, Address src, SILType T,
243243 const TypeInfo &ti) {
244- if (!IGF.IGM . getOptions (). UseTypeLayoutValueHandling ||
244+ if (!IGF.outliningCanCallValueWitnesses () ||
245245 T.hasArchetype () || !canUseValueWitnessForValueOp (*this , T)) {
246246 ti.initializeWithTake (IGF, dest, src, T, true );
247247 } else {
@@ -256,13 +256,13 @@ llvm::Constant *IRGenModule::getOrCreateOutlinedInitializeWithCopyFunction(
256256 auto manglingBits = getTypeAndGenericSignatureForManglingOutlineFunction (T);
257257 auto funcName =
258258 IRGenMangler ().mangleOutlinedInitializeWithCopyFunction (manglingBits.first ,
259- manglingBits.second );
259+ manglingBits.second , collector. IGF . isPerformanceConstraint );
260260
261261 return getOrCreateOutlinedCopyAddrHelperFunction (
262262 T, ti, collector, funcName,
263263 [this ](IRGenFunction &IGF, Address dest, Address src, SILType T,
264264 const TypeInfo &ti) {
265- if (!IGF.IGM . getOptions (). UseTypeLayoutValueHandling ||
265+ if (!IGF.outliningCanCallValueWitnesses () ||
266266 T.hasArchetype () || !canUseValueWitnessForValueOp (*this , T)) {
267267 ti.initializeWithCopy (IGF, dest, src, T, true );
268268 } else {
@@ -277,13 +277,13 @@ llvm::Constant *IRGenModule::getOrCreateOutlinedAssignWithTakeFunction(
277277 auto manglingBits = getTypeAndGenericSignatureForManglingOutlineFunction (T);
278278 auto funcName =
279279 IRGenMangler ().mangleOutlinedAssignWithTakeFunction (manglingBits.first ,
280- manglingBits.second );
280+ manglingBits.second , collector. IGF . isPerformanceConstraint );
281281
282282 return getOrCreateOutlinedCopyAddrHelperFunction (
283283 T, ti, collector, funcName,
284284 [this ](IRGenFunction &IGF, Address dest, Address src, SILType T,
285285 const TypeInfo &ti) {
286- if (!IGF.IGM . getOptions (). UseTypeLayoutValueHandling ||
286+ if (!IGF.outliningCanCallValueWitnesses () ||
287287 T.hasArchetype () || !canUseValueWitnessForValueOp (*this , T)) {
288288 ti.assignWithTake (IGF, dest, src, T, true );
289289 } else {
@@ -298,13 +298,13 @@ llvm::Constant *IRGenModule::getOrCreateOutlinedAssignWithCopyFunction(
298298 auto manglingBits = getTypeAndGenericSignatureForManglingOutlineFunction (T);
299299 auto funcName =
300300 IRGenMangler ().mangleOutlinedAssignWithCopyFunction (manglingBits.first ,
301- manglingBits.second );
301+ manglingBits.second , collector. IGF . isPerformanceConstraint );
302302
303303 return getOrCreateOutlinedCopyAddrHelperFunction (
304304 T, ti, collector, funcName,
305305 [this ](IRGenFunction &IGF, Address dest, Address src, SILType T,
306306 const TypeInfo &ti) {
307- if (!IGF.IGM . getOptions (). UseTypeLayoutValueHandling ||
307+ if (!IGF.outliningCanCallValueWitnesses () ||
308308 T.hasArchetype () || !canUseValueWitnessForValueOp (*this , T)) {
309309 ti.assignWithCopy (IGF, dest, src, T, true );
310310 } else {
@@ -334,7 +334,9 @@ llvm::Constant *IRGenModule::getOrCreateOutlinedCopyAddrHelperFunction(
334334 generator (IGF, dest, src, T, ti);
335335 IGF.Builder .CreateRet (dest.getAddress ());
336336 },
337- true /* setIsNoInline*/ );
337+ true /* setIsNoInline*/ ,
338+ false /* forPrologue*/ ,
339+ collector.IGF .isPerformanceConstraint );
338340}
339341
340342void TypeInfo::callOutlinedDestroy (IRGenFunction &IGF,
@@ -344,7 +346,7 @@ void TypeInfo::callOutlinedDestroy(IRGenFunction &IGF,
344346 return ;
345347
346348 if (!T.hasLocalArchetype () &&
347- !IGF.IGM . getOptions (). UseTypeLayoutValueHandling ) {
349+ !IGF.outliningCanCallValueWitnesses () ) {
348350 OutliningMetadataCollector collector (IGF);
349351 if (T.hasArchetype ()) {
350352 collectMetadataForOutlining (collector, T);
@@ -385,7 +387,7 @@ llvm::Constant *IRGenModule::getOrCreateOutlinedDestroyFunction(
385387 IRGenMangler mangler;
386388 auto manglingBits = getTypeAndGenericSignatureForManglingOutlineFunction (T);
387389 auto funcName = mangler.mangleOutlinedDestroyFunction (manglingBits.first ,
388- manglingBits.second );
390+ manglingBits.second , collector. IGF . isPerformanceConstraint );
389391
390392 auto ptrTy = ti.getStorageType ()->getPointerTo ();
391393 llvm::SmallVector<llvm::Type *, 4 > paramTys;
@@ -397,7 +399,7 @@ llvm::Constant *IRGenModule::getOrCreateOutlinedDestroyFunction(
397399 Explosion params = IGF.collectParameters ();
398400 Address addr = ti.getAddressForPointer (params.claimNext ());
399401 collector.bindMetadataParameters (IGF, params);
400- if (!IGF.IGM . getOptions (). UseTypeLayoutValueHandling ||
402+ if (!IGF.outliningCanCallValueWitnesses () ||
401403 T.hasArchetype () || !canUseValueWitnessForValueOp (*this , T)) {
402404 ti.destroy (IGF, addr, T, true );
403405 } else {
@@ -406,7 +408,9 @@ llvm::Constant *IRGenModule::getOrCreateOutlinedDestroyFunction(
406408
407409 IGF.Builder .CreateRet (addr.getAddress ());
408410 },
409- true /* setIsNoInline*/ );
411+ true /* setIsNoInline*/ ,
412+ false /* forPrologue*/ ,
413+ collector.IGF .isPerformanceConstraint );
410414}
411415
412416llvm::Constant *IRGenModule::getOrCreateRetainFunction (const TypeInfo &ti,
0 commit comments