Skip to content

Commit 39e5e39

Browse files
committed
IRGen: Co-locate metadata instatiation/completions/accessor functions in a special section
For spatial locality on startup. Hide collocating metadata functions in a separate section behind a flag. The default is not to collocate functions. rdar://101593202
1 parent cfbd52d commit 39e5e39

File tree

76 files changed

+147
-92
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+147
-92
lines changed

include/swift/AST/IRGenOptions.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,9 @@ class IRGenOptions {
419419

420420
unsigned DisableReadonlyStaticObjects : 1;
421421

422+
/// Collocate metadata functions in their own section.
423+
unsigned CollocatedMetadataFunctions : 1;
424+
422425
/// The number of threads for multi-threaded code generation.
423426
unsigned NumThreads = 0;
424427

@@ -489,7 +492,8 @@ class IRGenOptions {
489492
WitnessMethodElimination(false), ConditionalRuntimeRecords(false),
490493
InternalizeAtLink(false), InternalizeSymbols(false),
491494
EmitGenericRODatas(false), NoPreallocatedInstantiationCaches(false),
492-
DisableReadonlyStaticObjects(false), CmdArgs(),
495+
DisableReadonlyStaticObjects(false),
496+
CollocatedMetadataFunctions(false), CmdArgs(),
493497
SanitizeCoverage(llvm::SanitizerCoverageOptions()),
494498
TypeInfoFilter(TypeInfoDumpFilter::All) {
495499
#ifndef NDEBUG

include/swift/Option/FrontendOptions.td

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1105,6 +1105,13 @@ def enable_move_inout_stack_protector :
11051105
Flag<["-"], "enable-move-inout-stack-protector">,
11061106
HelpText<"Enable the stack protector by moving values to temporaries">;
11071107

1108+
def enable_collocate_metadata_functions :
1109+
Flag<["-"], "enable-collocate-metadata-functions">,
1110+
HelpText<"Enable collocate metadata functions">;
1111+
def disable_collocate_metadata_functions :
1112+
Flag<["-"], "disable-collocate-metadata-functions">,
1113+
HelpText<"Disable collocate metadata functions">;
1114+
11081115
def enable_new_llvm_pass_manager :
11091116
Flag<["-"], "enable-new-llvm-pass-manager">,
11101117
HelpText<"Enable the new llvm pass manager">;

lib/Frontend/CompilerInvocation.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2472,7 +2472,10 @@ static bool ParseIRGenArgs(IRGenOptions &Opts, ArgList &Args,
24722472
Args.hasFlag(OPT_disable_new_llvm_pass_manager,
24732473
OPT_enable_new_llvm_pass_manager,
24742474
Opts.LegacyPassManager);
2475-
2475+
Opts.CollocatedMetadataFunctions =
2476+
Args.hasFlag(OPT_enable_collocate_metadata_functions,
2477+
OPT_disable_collocate_metadata_functions,
2478+
Opts.CollocatedMetadataFunctions);
24762479
return false;
24772480
}
24782481

lib/IRGen/GenClass.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2511,6 +2511,7 @@ static llvm::Function *emitObjCMetadataUpdateFunction(IRGenModule &IGM,
25112511
llvm::Function *f =
25122512
IGM.getAddrOfObjCMetadataUpdateFunction(D, ForDefinition);
25132513
f->setAttributes(IGM.constructInitialAttributes());
2514+
IGM.setColocateMetadataSection(f);
25142515

25152516
IRGenFunction IGF(IGM, f);
25162517
if (IGM.DebugInfo)

lib/IRGen/GenDecl.cpp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1979,6 +1979,7 @@ void IRGenerator::emitEagerClassInitialization() {
19791979
IGM->DebugInfo->emitArtificialFunction(RegisterIGF, RegisterIGF.CurFn);
19801980
RegisterFn->setAttributes(IGM->constructInitialAttributes());
19811981
RegisterFn->setCallingConv(IGM->DefaultCC);
1982+
IGM->setColocateMetadataSection(RegisterFn);
19821983

19831984
for (ClassDecl *CD : ClassesForEagerInitialization) {
19841985
auto Ty = CD->getDeclaredType()->getCanonicalType();
@@ -2022,6 +2023,7 @@ void IRGenerator::emitObjCActorsNeedingSuperclassSwizzle() {
20222023
IGM->DebugInfo->emitArtificialFunction(RegisterIGF, RegisterIGF.CurFn);
20232024
RegisterFn->setAttributes(IGM->constructInitialAttributes());
20242025
RegisterFn->setCallingConv(IGM->DefaultCC);
2026+
IGM->setColocateMetadataSection(RegisterFn);
20252027

20262028
// Look up the SwiftNativeNSObject class.
20272029
auto swiftNativeNSObjectName =
@@ -5858,3 +5860,23 @@ IRGenModule::getOrCreateHelperFunction(StringRef fnName, llvm::Type *resultTy,
58585860

58595861
return fn;
58605862
}
5863+
5864+
void IRGenModule::setColocateMetadataSection(llvm::Function *f) {
5865+
if (!IRGen.Opts.CollocatedMetadataFunctions)
5866+
return;
5867+
5868+
switch (TargetInfo.OutputObjectFormat) {
5869+
case llvm::Triple::MachO:
5870+
f->setSection("__TEXT, __textg_swiftm, regular, pure_instructions");
5871+
break;
5872+
case llvm::Triple::DXContainer:
5873+
case llvm::Triple::GOFF:
5874+
case llvm::Triple::SPIRV:
5875+
case llvm::Triple::UnknownObjectFormat:
5876+
case llvm::Triple::Wasm:
5877+
case llvm::Triple::ELF:
5878+
case llvm::Triple::XCOFF:
5879+
case llvm::Triple::COFF:
5880+
break;
5881+
}
5882+
}

lib/IRGen/GenMeta.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ static void emitMetadataCompletionFunction(IRGenModule &IGM,
206206
f->setAttributes(IGM.constructInitialAttributes());
207207
f->setDoesNotThrow();
208208
IGM.setHasNoFramePointer(f);
209+
IGM.setColocateMetadataSection(f);
209210

210211
IRGenFunction IGF(IGM, f);
211212

@@ -2969,6 +2970,7 @@ namespace {
29692970
f->setAttributes(IGM.constructInitialAttributes());
29702971
f->setDoesNotThrow();
29712972
IGM.setHasNoFramePointer(f);
2973+
IGM.setColocateMetadataSection(f);
29722974

29732975
IRGenFunction IGF(IGM, f);
29742976

lib/IRGen/IRGenModule.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1572,6 +1572,8 @@ private: \
15721572
void appendLLVMUsedConditionalEntry(llvm::GlobalVariable *var,
15731573
const ProtocolConformance *conformance);
15741574

1575+
void setColocateMetadataSection(llvm::Function *f);
1576+
15751577
llvm::Constant *
15761578
getAddrOfTypeMetadata(CanType concreteType,
15771579
TypeMetadataCanonicality canonicality =

lib/IRGen/MetadataRequest.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2052,6 +2052,7 @@ void irgen::emitCacheAccessFunction(IRGenModule &IGM, llvm::Function *accessor,
20522052
accessor->addFnAttr(llvm::Attribute::NoInline);
20532053
// Accessor functions don't need frame pointers.
20542054
IGM.setHasNoFramePointer(accessor);
2055+
IGM.setColocateMetadataSection(accessor);
20552056

20562057
// This function is logically 'readnone': the caller does not need
20572058
// to reason about any side effects or stores it might perform.
@@ -2404,6 +2405,7 @@ MetadataResponse irgen::emitGenericTypeMetadataAccessFunction(
24042405
generateThunkFn,
24052406
/*noinline*/ true));
24062407
}
2408+
IGM.setColocateMetadataSection(thunkFn);
24072409

24082410
// Call out to the helper.
24092411
auto arg0 = numArguments >= 1
@@ -2674,6 +2676,8 @@ irgen::getGenericTypeMetadataAccessFunction(IRGenModule &IGM,
26742676
llvm::Function *accessor =
26752677
IGM.getAddrOfGenericTypeMetadataAccessFunction(
26762678
nominal, genericArgs.Types, shouldDefine);
2679+
if (shouldDefine)
2680+
IGM.setColocateMetadataSection(accessor);
26772681

26782682
// If we're not supposed to define the accessor, or if we already
26792683
// have defined it, just return the pointer.
@@ -2917,6 +2921,7 @@ emitMetadataAccessByMangledName(IRGenFunction &IGF, CanType type,
29172921
IGM.setHasNoFramePointer(subIGF.CurFn);
29182922
if (IGM.DebugInfo)
29192923
IGM.DebugInfo->emitArtificialFunction(subIGF, subIGF.CurFn);
2924+
IGM.setColocateMetadataSection(subIGF.CurFn);
29202925

29212926
auto params = subIGF.collectParameters();
29222927
auto cache = params.claimNext();
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// RUN: %target-swift-frontend -primary-file %s -emit-ir -enable-collocate-metadata-functions | %FileCheck %s
2+
3+
// REQUIRES: OS=macosx
4+
5+
// CHECK: define{{.*}} swiftcc %swift.metadata_response @"$s28collocate_metadata_functions13GenericStructVMr"({{.*}} section "__TEXT, __textg_swiftm, regular, pure_instructions"
6+
7+
public struct GenericStruct<T> {
8+
var field: T?
9+
}

test/IRGen/generic_classes.sil

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,5 +415,5 @@ entry(%c : $RootGeneric<Int32>):
415415
// CHECK: ret %swift.metadata_response [[T1]]
416416
// CHECK: }
417417

418-
// OSIZE: define hidden swiftcc %swift.metadata_response @"$s15generic_classes11RootGenericCMa"(i64 %0, %swift.type* {{.*}}) [[ATTRS:#[0-9]+]] {
418+
// OSIZE: define hidden swiftcc %swift.metadata_response @"$s15generic_classes11RootGenericCMa"(i64 %0, %swift.type* {{.*}}) [[ATTRS:#[0-9]+]] {{(section)?.*}}{
419419
// OSIZE: [[ATTRS]] = {{{.*}}noinline

test/IRGen/prespecialized-metadata/class-fileprivate-2argument-1_distinct_use-1st_argument_generic_class-2nd_argument_distinct_generic_class.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ func doit() {
234234
}
235235
doit()
236236

237-
// CHECK: define internal swiftcc %swift.metadata_response @"$s4main5Value[[UNIQUE_ID_1]]LLCMa"([[INT]] [[METADATA_REQUEST:%[0-9]+]], %swift.type* [[ARGUMENT1_METADATA:%[0-9]+]], %swift.type* [[ARGUMENT2_METADATA:%[0-9]+]]) #{{[0-9]+}} {
237+
// CHECK: define internal swiftcc %swift.metadata_response @"$s4main5Value[[UNIQUE_ID_1]]LLCMa"([[INT]] [[METADATA_REQUEST:%[0-9]+]], %swift.type* [[ARGUMENT1_METADATA:%[0-9]+]], %swift.type* [[ARGUMENT2_METADATA:%[0-9]+]]) #{{[0-9]+}} {{(section)?.*}}{
238238
// CHECK: entry:
239239
// CHECK: [[ERASED_ARGUMENT1:%[0-9]+]] = bitcast %swift.type* [[ARGUMENT1_METADATA]] to i8*
240240
// CHECK: [[ERASED_ARGUMENT2:%[0-9]+]] = bitcast %swift.type* [[ARGUMENT2_METADATA]] to i8*
@@ -253,7 +253,7 @@ doit()
253253
// CHECK: }
254254

255255

256-
// CHECK: define linkonce_odr hidden swiftcc %swift.metadata_response @"$s4main5Value[[UNIQUE_ID_4]]LLCyAA9Argument1ACLLCySiGAA9Argument2ACLLCySSGGMb"([[INT]] {{%[0-9]+}}) {{#[0-9]}} {
256+
// CHECK: define linkonce_odr hidden swiftcc %swift.metadata_response @"$s4main5Value[[UNIQUE_ID_4]]LLCyAA9Argument1ACLLCySiGAA9Argument2ACLLCySSGGMb"([[INT]] {{%[0-9]+}}) {{#[0-9]}} {{(section)?.*}}{
257257
// CHECK: entry:
258258
// CHECK: call swiftcc %swift.metadata_response @"$s4main9Argument1[[UNIQUE_ID_1]]LLCySiGMb"([[INT]] 0)
259259
// CHECK: call swiftcc %swift.metadata_response @"$s4main9Argument2[[UNIQUE_ID_1]]LLCySSGMb"([[INT]] 0)

test/IRGen/prespecialized-metadata/class-fileprivate-2argument-1_distinct_use-1st_argument_generic_class-2nd_argument_same_generic_class_different_value.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ func doit() {
224224
}
225225
doit()
226226

227-
// CHECK: define internal swiftcc %swift.metadata_response @"$s4main5Value[[UNIQUE_ID_1]]LLCMa"([[INT]] [[METADATA_REQUEST:%[0-9]+]], %swift.type* [[ARGUMENT1_METADATA:%[0-9]+]], %swift.type* [[ARGUMENT2_METADATA:%[0-9]+]]) #{{[0-9]+}} {
227+
// CHECK: define internal swiftcc %swift.metadata_response @"$s4main5Value[[UNIQUE_ID_1]]LLCMa"([[INT]] [[METADATA_REQUEST:%[0-9]+]], %swift.type* [[ARGUMENT1_METADATA:%[0-9]+]], %swift.type* [[ARGUMENT2_METADATA:%[0-9]+]]) #{{[0-9]+}} {{(section)?.*}}{
228228
// CHECK: entry:
229229
// CHECK: [[ERASED_ARGUMENT1:%[0-9]+]] = bitcast %swift.type* [[ARGUMENT1_METADATA]] to i8*
230230
// CHECK: [[ERASED_ARGUMENT2:%[0-9]+]] = bitcast %swift.type* [[ARGUMENT2_METADATA]] to i8*
@@ -243,7 +243,7 @@ doit()
243243
// CHECK: }
244244

245245

246-
// CHECK: define linkonce_odr hidden swiftcc %swift.metadata_response @"$s4main5Value[[UNIQUE_ID_4]]LLCyAA9Argument1ACLLCySiGAFySSGGMb"([[INT]] {{%[0-9]+}}) {{#[0-9]}} {
246+
// CHECK: define linkonce_odr hidden swiftcc %swift.metadata_response @"$s4main5Value[[UNIQUE_ID_4]]LLCyAA9Argument1ACLLCySiGAFySSGGMb"([[INT]] {{%[0-9]+}}) {{#[0-9]}} {{(section)?.*}}{
247247
// CHECK: entry:
248248
// CHECK: call swiftcc %swift.metadata_response @"$s4main9Argument1[[UNIQUE_ID_1]]LLCySiGMb"([[INT]] 0)
249249
// CHECK: call swiftcc %swift.metadata_response @"$s4main9Argument1[[UNIQUE_ID_1]]LLCySSGMb"([[INT]] 0)

test/IRGen/prespecialized-metadata/class-fileprivate-2argument-1_distinct_use-1st_argument_generic_class-2nd_argument_same_generic_class_same_value.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ func doit() {
224224
}
225225
doit()
226226

227-
// CHECK: define internal swiftcc %swift.metadata_response @"$s4main5Value[[UNIQUE_ID_1]]LLCMa"([[INT]] [[METADATA_REQUEST:%[0-9]+]], %swift.type* [[ARGUMENT1_METADATA:%[0-9]+]], %swift.type* [[ARGUMENT2_METADATA:%[0-9]+]]) #{{[0-9]+}} {
227+
// CHECK: define internal swiftcc %swift.metadata_response @"$s4main5Value[[UNIQUE_ID_1]]LLCMa"([[INT]] [[METADATA_REQUEST:%[0-9]+]], %swift.type* [[ARGUMENT1_METADATA:%[0-9]+]], %swift.type* [[ARGUMENT2_METADATA:%[0-9]+]]) #{{[0-9]+}} {{(section)?.*}}{
228228
// CHECK: entry:
229229
// CHECK: [[ERASED_ARGUMENT1:%[0-9]+]] = bitcast %swift.type* [[ARGUMENT1_METADATA]] to i8*
230230
// CHECK: [[ERASED_ARGUMENT2:%[0-9]+]] = bitcast %swift.type* [[ARGUMENT2_METADATA]] to i8*
@@ -243,7 +243,7 @@ doit()
243243
// CHECK: }
244244

245245

246-
// CHECK: define linkonce_odr hidden swiftcc %swift.metadata_response @"$s4main5Value[[UNIQUE_ID_4]]LLCyAA9Argument1ACLLCySiGAGGMb"([[INT]] {{%[0-9]+}}) {{#[0-9]}} {
246+
// CHECK: define linkonce_odr hidden swiftcc %swift.metadata_response @"$s4main5Value[[UNIQUE_ID_4]]LLCyAA9Argument1ACLLCySiGAGGMb"([[INT]] {{%[0-9]+}}) {{#[0-9]}} {{(section)?.*}}{
247247
// CHECK: entry:
248248
// CHECK: call swiftcc %swift.metadata_response @"$s4main9Argument1[[UNIQUE_ID_1]]LLCySiGMb"([[INT]] 0)
249249
// CHECK-NOT: call swiftcc %swift.metadata_response @"$s4main9Argument1[[UNIQUE_ID_1]]LLCySiGMb"([[INT]] 0)

test/IRGen/prespecialized-metadata/class-fileprivate-inmodule-1arg-2ancs-1distinct_use-1st_anc_gen-1arg-1st_arg_con_int-2nd_anc_gen-1st-arg_con_double.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ func doit() {
236236
}
237237
doit()
238238

239-
// CHECK: define internal swiftcc %swift.metadata_response @"$s4main9Ancestor2[[UNIQUE_ID_1]]CMa"([[INT]] [[METADATA_REQUEST:%[0-9]+]], %swift.type* %1) #{{[0-9]+}} {
239+
// CHECK: define internal swiftcc %swift.metadata_response @"$s4main9Ancestor2[[UNIQUE_ID_1]]CMa"([[INT]] [[METADATA_REQUEST:%[0-9]+]], %swift.type* %1) #{{[0-9]+}} {{(section)?.*}}{
240240
// CHECK: entry:
241241
// CHECK: [[ERASED_TYPE:%[0-9]+]] = bitcast %swift.type* %1 to i8*
242242
// CHECK: {{%[0-9]+}} = call swiftcc %swift.metadata_response @__swift_instantiateCanonicalPrespecializedGenericMetadata(
@@ -253,7 +253,7 @@ doit()
253253
// CHECK: ret %swift.metadata_response {{%[0-9]+}}
254254
// CHECK: }
255255

256-
// CHECK: define internal swiftcc %swift.metadata_response @"$s4main9Ancestor1[[UNIQUE_ID_1]]CMa"([[INT]] [[METADATA_REQUEST:%[0-9]+]], %swift.type* %1) #{{[0-9]+}} {
256+
// CHECK: define internal swiftcc %swift.metadata_response @"$s4main9Ancestor1[[UNIQUE_ID_1]]CMa"([[INT]] [[METADATA_REQUEST:%[0-9]+]], %swift.type* %1) #{{[0-9]+}} {{(section)?.*}}{
257257
// CHECK: entry:
258258
// CHECK: [[ERASED_TYPE:%[0-9]+]] = bitcast %swift.type* %1 to i8*
259259
// CHECK: {{%[0-9]+}} = call swiftcc %swift.metadata_response @__swift_instantiateCanonicalPrespecializedGenericMetadata(
@@ -270,7 +270,7 @@ doit()
270270
// CHECK: ret %swift.metadata_response {{%[0-9]+}}
271271
// CHECK: }
272272

273-
// CHECK: define internal swiftcc %swift.metadata_response @"$s4main5Value[[UNIQUE_ID_1]]CMa"([[INT]] [[METADATA_REQUEST:%[0-9]+]], %swift.type* %1) #{{[0-9]+}} {
273+
// CHECK: define internal swiftcc %swift.metadata_response @"$s4main5Value[[UNIQUE_ID_1]]CMa"([[INT]] [[METADATA_REQUEST:%[0-9]+]], %swift.type* %1) #{{[0-9]+}} {{(section)?.*}}{
274274
// CHECK: entry:
275275
// CHECK: [[ERASED_TYPE:%[0-9]+]] = bitcast %swift.type* %1 to i8*
276276
// CHECK: {{%[0-9]+}} = call swiftcc %swift.metadata_response @__swift_instantiateCanonicalPrespecializedGenericMetadata(
@@ -288,7 +288,7 @@ doit()
288288
// CHECK: }
289289

290290
// CHECK: ; Function Attrs: noinline nounwind readnone
291-
// CHECK: define linkonce_odr hidden swiftcc %swift.metadata_response @"$s4main5Value[[UNIQUE_ID_1]]CySSGMb"([[INT]] {{%[0-9]+}}) #{{[0-9]+}} {
291+
// CHECK: define linkonce_odr hidden swiftcc %swift.metadata_response @"$s4main5Value[[UNIQUE_ID_1]]CySSGMb"([[INT]] {{%[0-9]+}}) #{{[0-9]+}} {{(section)?.*}}{
292292
// CHECK: entry:
293293
// CHECK: call swiftcc %swift.metadata_response @"$s4main9Ancestor1[[UNIQUE_ID_1]]CySiGMb"([[INT]] 0)
294294
// CHECK-NOT: call swiftcc %swift.metadata_response @"$s4main9Ancestor2[[UNIQUE_ID_1]]CySiGMb"([[INT]] 0)

test/IRGen/prespecialized-metadata/class-fileprivate-inmodule-1arg-2ancs-1distinct_use-1st_anc_gen-1arg-1st_arg_con_int-2nd_anc_gen-1st-arg_subclass_arg.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ func doit() {
221221
}
222222
doit()
223223

224-
// CHECK: define internal swiftcc %swift.metadata_response @"$s4main9Ancestor2[[UNIQUE_ID_1]]CMa"([[INT]] [[METADATA_REQUEST:%[0-9]+]], %swift.type* %1) #{{[0-9]+}} {
224+
// CHECK: define internal swiftcc %swift.metadata_response @"$s4main9Ancestor2[[UNIQUE_ID_1]]CMa"([[INT]] [[METADATA_REQUEST:%[0-9]+]], %swift.type* %1) #{{[0-9]+}} {{(section)?.*}}{
225225
// CHECK: entry:
226226
// CHECK: [[ERASED_TYPE:%[0-9]+]] = bitcast %swift.type* %1 to i8*
227227
// CHECK: {{%[0-9]+}} = call swiftcc %swift.metadata_response @__swift_instantiateCanonicalPrespecializedGenericMetadata(
@@ -238,7 +238,7 @@ doit()
238238
// CHECK: ret %swift.metadata_response {{%[0-9]+}}
239239
// CHECK: }
240240

241-
// CHECK: define internal swiftcc %swift.metadata_response @"$s4main9Ancestor1[[UNIQUE_ID_1]]CMa"([[INT]] [[METADATA_REQUEST:%[0-9]+]], %swift.type* %1) #{{[0-9]+}} {
241+
// CHECK: define internal swiftcc %swift.metadata_response @"$s4main9Ancestor1[[UNIQUE_ID_1]]CMa"([[INT]] [[METADATA_REQUEST:%[0-9]+]], %swift.type* %1) #{{[0-9]+}} {{(section)?.*}}{
242242
// CHECK: entry:
243243
// CHECK: [[ERASED_TYPE:%[0-9]+]] = bitcast %swift.type* %1 to i8*
244244
// CHECK: {{%[0-9]+}} = call swiftcc %swift.metadata_response @__swift_instantiateCanonicalPrespecializedGenericMetadata(
@@ -255,7 +255,7 @@ doit()
255255
// CHECK: ret %swift.metadata_response {{%[0-9]+}}
256256
// CHECK: }
257257

258-
// CHECK: define internal swiftcc %swift.metadata_response @"$s4main5Value[[UNIQUE_ID_1]]CMa"([[INT]] [[METADATA_REQUEST:%[0-9]+]], %swift.type* %1) #{{[0-9]+}} {
258+
// CHECK: define internal swiftcc %swift.metadata_response @"$s4main5Value[[UNIQUE_ID_1]]CMa"([[INT]] [[METADATA_REQUEST:%[0-9]+]], %swift.type* %1) #{{[0-9]+}} {{(section)?.*}}{
259259
// CHECK: entry:
260260
// CHECK: [[ERASED_TYPE:%[0-9]+]] = bitcast %swift.type* %1 to i8*
261261
// CHECK: {{%[0-9]+}} = call swiftcc %swift.metadata_response @__swift_instantiateCanonicalPrespecializedGenericMetadata(
@@ -273,7 +273,7 @@ doit()
273273
// CHECK: }
274274

275275
// CHECK: ; Function Attrs: noinline nounwind readnone
276-
// CHECK: define linkonce_odr hidden swiftcc %swift.metadata_response @"$s4main5Value[[UNIQUE_ID_1]]CySSGMb"([[INT]] {{%[0-9]+}}) #{{[0-9]+}} {
276+
// CHECK: define linkonce_odr hidden swiftcc %swift.metadata_response @"$s4main5Value[[UNIQUE_ID_1]]CySSGMb"([[INT]] {{%[0-9]+}}) #{{[0-9]+}} {{(section)?.*}}{
277277
// CHECK: entry:
278278
// CHECK: call swiftcc %swift.metadata_response @"$s4main9Ancestor1[[UNIQUE_ID_1]]CySiGMb"([[INT]] 0)
279279
// CHECK-NOT: call swiftcc %swift.metadata_response @"$s4main9Ancestor2[[UNIQUE_ID_1]]CySiGMb"([[INT]] 0)

test/IRGen/prespecialized-metadata/class-fileprivate-inmodule-1arg-2ancs-1distinct_use-1st_anc_gen-1arg-1st_arg_subclass_arg-2nd_anc_gen-1st-arg_con_int.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ func doit() {
225225
}
226226
doit()
227227

228-
// CHECK: define internal swiftcc %swift.metadata_response @"$s4main9Ancestor2[[UNIQUE_ID_1]]LLCMa"([[INT]] [[METADATA_REQUEST:%[0-9]+]], %swift.type* %1) #{{[0-9]+}} {
228+
// CHECK: define internal swiftcc %swift.metadata_response @"$s4main9Ancestor2[[UNIQUE_ID_1]]LLCMa"([[INT]] [[METADATA_REQUEST:%[0-9]+]], %swift.type* %1) #{{[0-9]+}} {{(section)?.*}}{
229229
// CHECK: entry:
230230
// CHECK: [[ERASED_TYPE:%[0-9]+]] = bitcast %swift.type* %1 to i8*
231231
// CHECK: {{%[0-9]+}} = call swiftcc %swift.metadata_response @__swift_instantiateCanonicalPrespecializedGenericMetadata(
@@ -242,7 +242,7 @@ doit()
242242
// CHECK: ret %swift.metadata_response {{%[0-9]+}}
243243
// CHECK: }
244244

245-
// CHECK: define internal swiftcc %swift.metadata_response @"$s4main9Ancestor1[[UNIQUE_ID_1]]LLCMa"([[INT]] [[METADATA_REQUEST:%[0-9]+]], %swift.type* %1) #{{[0-9]+}} {
245+
// CHECK: define internal swiftcc %swift.metadata_response @"$s4main9Ancestor1[[UNIQUE_ID_1]]LLCMa"([[INT]] [[METADATA_REQUEST:%[0-9]+]], %swift.type* %1) #{{[0-9]+}} {{(section)?.*}}{
246246
// CHECK: entry:
247247
// CHECK: [[ERASED_TYPE:%[0-9]+]] = bitcast %swift.type* %1 to i8*
248248
// CHECK: {{%[0-9]+}} = call swiftcc %swift.metadata_response @__swift_instantiateCanonicalPrespecializedGenericMetadata(
@@ -259,7 +259,7 @@ doit()
259259
// CHECK: ret %swift.metadata_response {{%[0-9]+}}
260260
// CHECK: }
261261

262-
// CHECK: define internal swiftcc %swift.metadata_response @"$s4main5Value[[UNIQUE_ID_1]]LLCMa"([[INT]] [[METADATA_REQUEST:%[0-9]+]], %swift.type* %1) #{{[0-9]+}} {
262+
// CHECK: define internal swiftcc %swift.metadata_response @"$s4main5Value[[UNIQUE_ID_1]]LLCMa"([[INT]] [[METADATA_REQUEST:%[0-9]+]], %swift.type* %1) #{{[0-9]+}} {{(section)?.*}}{
263263
// CHECK: entry:
264264
// CHECK: [[ERASED_TYPE:%[0-9]+]] = bitcast %swift.type* %1 to i8*
265265
// CHECK: {{%[0-9]+}} = call swiftcc %swift.metadata_response @__swift_instantiateCanonicalPrespecializedGenericMetadata(
@@ -277,7 +277,7 @@ doit()
277277
// CHECK: }
278278

279279
// CHECK: ; Function Attrs: noinline nounwind readnone
280-
// CHECK: define linkonce_odr hidden swiftcc %swift.metadata_response @"$s4main5Value[[UNIQUE_ID_1]]LLCySSGMb"([[INT]] {{%[0-9]+}}) #{{[0-9]+}} {
280+
// CHECK: define linkonce_odr hidden swiftcc %swift.metadata_response @"$s4main5Value[[UNIQUE_ID_1]]LLCySSGMb"([[INT]] {{%[0-9]+}}) #{{[0-9]+}} {{(section)?.*}}{
281281
// CHECK: entry:
282282
// CHECK: call swiftcc %swift.metadata_response @"$s4main9Ancestor1[[UNIQUE_ID_1]]LLCySSGMb"([[INT]] 0)
283283
// CHECK-NOT: call swiftcc %swift.metadata_response @"$s4main9Ancestor2[[UNIQUE_ID_1]]LLCySiGMb"([[INT]] 0)

0 commit comments

Comments
 (0)