Skip to content

Commit c246626

Browse files
authored
Merge pull request #16933 from adrian-prantl/irgen-g
2 parents b524329 + a95791c commit c246626

25 files changed

+183
-108
lines changed

lib/IRGen/IRGenSIL.cpp

Lines changed: 71 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -862,6 +862,18 @@ class IRGenSILFunction :
862862
return VarDecl->getInterfaceType()->hasTypeParameter();
863863
}
864864

865+
/// Force all archetypes referenced by the type to be bound by this point.
866+
/// TODO: just make sure that we have a path to them that the debug info
867+
/// can follow.
868+
void bindArchetypes(swift::Type Ty) {
869+
auto runtimeTy = getRuntimeReifiedType(IGM, Ty->getCanonicalType());
870+
if (!IGM.IRGen.Opts.shouldOptimize() && runtimeTy->hasArchetype())
871+
runtimeTy.visit([&](CanType t) {
872+
if (auto archetype = dyn_cast<ArchetypeType>(t))
873+
emitTypeMetadataRef(archetype);
874+
});
875+
}
876+
865877
/// Emit debug info for a function argument or a local variable.
866878
template <typename StorageType>
867879
void emitDebugVariableDeclaration(StorageType Storage,
@@ -872,23 +884,11 @@ class IRGenSILFunction :
872884
StringRef Name,
873885
unsigned ArgNo = 0,
874886
IndirectionKind Indirection = DirectValue) {
875-
// Force all archetypes referenced by the type to be bound by this point.
876-
// TODO: just make sure that we have a path to them that the debug info
877-
// can follow.
878-
879887
// FIXME: The debug info type of all inlined instances of a variable must be
880888
// the same as the type of the abstract variable.
881889
if (isInlinedGeneric(VarDecl, DS))
882890
return;
883891

884-
auto runtimeTy = getRuntimeReifiedType(IGM,
885-
Ty.getType()->getCanonicalType());
886-
if (!IGM.IRGen.Opts.shouldOptimize() && runtimeTy->hasArchetype())
887-
runtimeTy.visit([&](CanType t) {
888-
if (auto archetype = dyn_cast<ArchetypeType>(t))
889-
emitTypeMetadataRef(archetype);
890-
});
891-
892892
assert(IGM.DebugInfo && "debug info not enabled");
893893
if (ArgNo) {
894894
PrologueLocation AutoRestore(IGM.DebugInfo, Builder);
@@ -3636,6 +3636,8 @@ void IRGenSILFunction::emitErrorResultVar(SILResultInfo ErrorInfo,
36363636
auto Storage =
36373637
emitShadowCopyIfNeeded(ErrorResultSlot.getAddress(), getDebugScope(),
36383638
Var->Name, Var->ArgNo, false);
3639+
if (!IGM.DebugInfo)
3640+
return;
36393641
DebugTypeInfo DTI(nullptr, nullptr, ErrorInfo.getType(),
36403642
ErrorResultSlot->getType(), IGM.getPointerSize(),
36413643
IGM.getPointerAlignment(), true);
@@ -3645,9 +3647,6 @@ void IRGenSILFunction::emitErrorResultVar(SILResultInfo ErrorInfo,
36453647
}
36463648

36473649
void IRGenSILFunction::visitDebugValueInst(DebugValueInst *i) {
3648-
if (!IGM.DebugInfo)
3649-
return;
3650-
36513650
if (i->getDebugScope()->getInlinedFunction()->isTransparent())
36523651
return;
36533652

@@ -3686,14 +3685,15 @@ void IRGenSILFunction::visitDebugValueInst(DebugValueInst *i) {
36863685
llvm::SmallVector<llvm::Value *, 8> Copy;
36873686
emitShadowCopyIfNeeded(SILVal, i->getDebugScope(), Name, VarInfo->ArgNo,
36883687
IsAnonymous, Copy);
3688+
bindArchetypes(DbgTy.getType());
3689+
if (!IGM.DebugInfo)
3690+
return;
3691+
36893692
emitDebugVariableDeclaration(Copy, DbgTy, SILTy, i->getDebugScope(),
36903693
i->getDecl(), Name, VarInfo->ArgNo);
36913694
}
36923695

36933696
void IRGenSILFunction::visitDebugValueAddrInst(DebugValueAddrInst *i) {
3694-
if (!IGM.DebugInfo)
3695-
return;
3696-
36973697
if (i->getDebugScope()->getInlinedFunction()->isTransparent())
36983698
return;
36993699

@@ -3723,6 +3723,10 @@ void IRGenSILFunction::visitDebugValueAddrInst(DebugValueAddrInst *i) {
37233723
auto DbgTy = DebugTypeInfo::getLocalVariable(
37243724
CurSILFn->getDeclContext(), CurSILFn->getGenericEnvironment(), Decl,
37253725
RealType, getTypeInfo(SILVal->getType()), Unwrap);
3726+
bindArchetypes(DbgTy.getType());
3727+
if (!IGM.DebugInfo)
3728+
return;
3729+
37263730
// Put the value's address into a stack slot at -Onone and emit a debug
37273731
// intrinsic.
37283732
emitDebugVariableDeclaration(
@@ -3994,26 +3998,29 @@ void IRGenSILFunction::emitDebugInfoForAllocStack(AllocStackInst *i,
39943998
Indirection = IndirectValue;
39953999
}
39964000

3997-
if (IGM.DebugInfo && Decl) {
3998-
// Ignore compiler-generated patterns but not optional bindings.
3999-
if (auto *Pattern = Decl->getParentPattern())
4000-
if (Pattern->isImplicit() &&
4001-
Pattern->getKind() != PatternKind::OptionalSome)
4002-
return;
4001+
if (!Decl)
4002+
return;
40034003

4004-
SILType SILTy = i->getType();
4005-
auto RealType = SILTy.getASTType();
4006-
auto DbgTy = DebugTypeInfo::getLocalVariable(
4007-
CurSILFn->getDeclContext(), CurSILFn->getGenericEnvironment(), Decl,
4008-
RealType, type, false);
4004+
// Ignore compiler-generated patterns but not optional bindings.
4005+
if (auto *Pattern = Decl->getParentPattern())
4006+
if (Pattern->isImplicit() &&
4007+
Pattern->getKind() != PatternKind::OptionalSome)
4008+
return;
4009+
4010+
SILType SILTy = i->getType();
4011+
auto RealType = SILTy.getASTType();
4012+
auto DbgTy = DebugTypeInfo::getLocalVariable(
4013+
CurSILFn->getDeclContext(), CurSILFn->getGenericEnvironment(), Decl,
4014+
RealType, type, false);
40094015

4010-
// FIXME: This is working around the inverse special case in LLDB.
4011-
if (DbgTy.isImplicitlyIndirect())
4012-
Indirection = DirectValue;
4016+
// FIXME: This is working around the inverse special case in LLDB.
4017+
if (DbgTy.isImplicitlyIndirect())
4018+
Indirection = DirectValue;
40134019

4020+
bindArchetypes(DbgTy.getType());
4021+
if (IGM.DebugInfo)
40144022
emitDebugVariableDeclaration(addr, DbgTy, SILTy, DS, Decl, Name,
40154023
VarInfo->ArgNo, Indirection);
4016-
}
40174024
}
40184025

40194026
void IRGenSILFunction::visitAllocStackInst(swift::AllocStackInst *i) {
@@ -4184,34 +4191,39 @@ void IRGenSILFunction::visitAllocBoxInst(swift::AllocBoxInst *i) {
41844191

41854192
if (i->getDebugScope()->getInlinedFunction()->isTransparent())
41864193
return;
4187-
4188-
if (IGM.DebugInfo && Decl) {
4189-
// FIXME: This is a workaround to not produce local variables for
4190-
// capture list arguments like "[weak self]". The better solution
4191-
// would be to require all variables to be described with a
4192-
// SILDebugValue(Addr) and then not describe capture list
4193-
// arguments.
4194-
if (Name == IGM.Context.Id_self.str())
4195-
return;
41964194

4197-
assert(i->getBoxType()->getLayout()->getFields().size() == 1
4198-
&& "box for a local variable should only have one field");
4199-
auto SILTy = i->getBoxType()->getFieldType(IGM.getSILModule(), 0);
4200-
auto RealType = SILTy.getASTType();
4201-
auto DbgTy = DebugTypeInfo::getLocalVariable(
4202-
CurSILFn->getDeclContext(), CurSILFn->getGenericEnvironment(), Decl,
4203-
RealType, type, /*Unwrap=*/false);
4195+
if (!Decl)
4196+
return;
4197+
// FIXME: This is a workaround to not produce local variables for
4198+
// capture list arguments like "[weak self]". The better solution
4199+
// would be to require all variables to be described with a
4200+
// SILDebugValue(Addr) and then not describe capture list
4201+
// arguments.
4202+
if (Name == IGM.Context.Id_self.str())
4203+
return;
42044204

4205-
if (isInlinedGeneric(Decl, i->getDebugScope()))
4206-
return;
4205+
assert(i->getBoxType()->getLayout()->getFields().size() == 1 &&
4206+
"box for a local variable should only have one field");
4207+
auto SILTy = i->getBoxType()->getFieldType(IGM.getSILModule(), 0);
4208+
auto RealType = SILTy.getASTType();
4209+
auto DbgTy = DebugTypeInfo::getLocalVariable(
4210+
CurSILFn->getDeclContext(), CurSILFn->getGenericEnvironment(), Decl,
4211+
RealType, type, /*Unwrap=*/false);
42074212

4208-
IGM.DebugInfo->emitVariableDeclaration(
4209-
Builder,
4210-
emitShadowCopyIfNeeded(boxWithAddr.getAddress(), i->getDebugScope(),
4211-
Name, 0, IsAnonymous),
4212-
DbgTy, i->getDebugScope(), Decl, Name, 0,
4213-
DbgTy.isImplicitlyIndirect() ? DirectValue : IndirectValue);
4214-
}
4213+
if (isInlinedGeneric(Decl, i->getDebugScope()))
4214+
return;
4215+
4216+
auto Storage = emitShadowCopyIfNeeded(
4217+
boxWithAddr.getAddress(), i->getDebugScope(), Name, 0, IsAnonymous);
4218+
4219+
if (!IGM.DebugInfo)
4220+
return;
4221+
4222+
IGM.DebugInfo->emitVariableDeclaration(
4223+
Builder,
4224+
Storage,
4225+
DbgTy, i->getDebugScope(), Decl, Name, 0,
4226+
DbgTy.isImplicitlyIndirect() ? DirectValue : IndirectValue);
42154227
}
42164228

42174229
void IRGenSILFunction::visitProjectBoxInst(swift::ProjectBoxInst *i) {
@@ -4773,6 +4785,7 @@ void IRGenSILFunction::visitObjCExistentialMetatypeToObjectInst(
47734785
to.add(value);
47744786
setLoweredExplosion(i, to);
47754787
}
4788+
47764789
void IRGenSILFunction::visitObjCProtocolInst(ObjCProtocolInst *i) {
47774790
// Get the protocol reference.
47784791
llvm::Value *protoRef = emitReferenceToObjCProtocol(*this, i->getProtocol());

lib/IRGen/LocalTypeData.cpp

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -317,28 +317,41 @@ LocalTypeDataCache::AbstractCacheEntry::follow(IRGenFunction &IGF,
317317
static void maybeEmitDebugInfoForLocalTypeData(IRGenFunction &IGF,
318318
LocalTypeDataKey key,
319319
MetadataResponse value) {
320-
// Only if debug info is enabled.
321-
if (!IGF.IGM.DebugInfo) return;
322-
320+
// FIXME: This check doesn't entirely behave correctly for non-transparent
321+
// functions that were inlined into transparent functions. Correct would be to
322+
// check which instruction requests the type metadata and see whether its
323+
// inlined function is transparent.
324+
auto * DS = IGF.getDebugScope();
325+
if (DS && DS->getInlinedFunction() &&
326+
DS->getInlinedFunction()->isTransparent())
327+
return;
328+
323329
// Only for formal type metadata.
324-
if (key.Kind != LocalTypeDataKind::forFormalTypeMetadata()) return;
330+
if (key.Kind != LocalTypeDataKind::forFormalTypeMetadata())
331+
return;
325332

326333
// Only for archetypes, and not for opened archetypes.
327334
auto type = dyn_cast<ArchetypeType>(key.Type);
328-
if (!type) return;
329-
if (type->getOpenedExistentialType()) return;
335+
if (!type)
336+
return;
337+
if (type->getOpenedExistentialType())
338+
return;
330339

331340
llvm::Value *data = value.getMetadata();
332341

333342
// At -O0, create an alloca to keep the type alive.
334343
auto name = type->getFullName();
335344
if (!IGF.IGM.IRGen.Opts.shouldOptimize()) {
336-
auto temp = IGF.createAlloca(data->getType(), IGF.IGM.getPointerAlignment(),
337-
name);
338-
IGF.Builder.CreateStore(data, temp);
339-
data = temp.getAddress();
345+
auto alloca =
346+
IGF.createAlloca(data->getType(), IGF.IGM.getPointerAlignment(), name);
347+
IGF.Builder.CreateStore(data, alloca);
348+
data = alloca.getAddress();
340349
}
341350

351+
// Only if debug info is enabled.
352+
if (!IGF.IGM.DebugInfo)
353+
return;
354+
342355
// Emit debug info for the metadata.
343356
IGF.IGM.DebugInfo->emitTypeMetadata(IGF, data, name);
344357
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// RUN: %target-swift-frontend -primary-file %s -emit-ir -g -o - | %FileCheck %s
2+
3+
public protocol P {
4+
var v : Int32 { get };
5+
}
6+
7+
public extension P {
8+
// CHECK: define {{.*}}swiftcc i32 @"$S4main1PPAAE1fs5Int32VyF"
9+
public func f() -> Int32 {
10+
// CHECK-NEXT: entry:
11+
// CHECK-NEXT: %[[ALLOCA:.*]] = alloca %swift.type*,
12+
// CHECK-NEXT: @llvm.dbg.declare(metadata %swift.type** %[[ALLOCA]],
13+
// CHECK-SAME: metadata ![[SELFMETA:.*]], metadata !DIExpression())
14+
return v
15+
}
16+
}
17+
18+
// CHECK: ![[SELFMETA]] = !DILocalVariable(name: "$swift.type.Self",
19+
// CHECK-SAME: type: ![[SELFTY:[0-9]+]], flags: DIFlagArtificial)
20+
// CHECK: ![[SELFTY]] = !DIDerivedType(tag: DW_TAG_typedef, name: "$swift.type"

test/IRGen/abitypes.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,9 @@ class Foo {
120120
// x86_64-macosx: define hidden swiftcc float @"$S8abitypes3FooC25getXFromRectIndirectSwift{{[_0-9a-zA-Z]*}}F"(i64, i64, %T8abitypes3FooC* swiftself) {{.*}} {
121121
func getXFromRectIndirectSwift(_ r: MyRect) -> Float {
122122
let f : Float = 1.0
123+
// x86_64-macosx: alloca
124+
// x86_64-macosx: alloca
125+
// x86_64-macosx: alloca
123126
// x86_64-macosx: [[TEMP:%.*]] = alloca [[TEMPTYPE:%.*]], align 8
124127
// x86_64-macosx: [[RESULT:%.*]] = call float bitcast (void ()* @objc_msgSend to float (i8*, i8*, float, float, float, float, float, float, float, [[TEMPTYPE]]*)*)(i8* %{{.*}}, i8* %{{.*}}, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, [[TEMPTYPE]]* byval align 8 [[TEMP]])
125128
// x86_64-macosx: ret float [[RESULT]]

test/IRGen/alloc_stack.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ class Foobar {
1010

1111
// Make sure we are mis-initializing the alloca.
1212
// CHECK-LABEL: define {{.*}}swiftcc %T11alloc_stack6FoobarC* @"$S11alloc_stack6FoobarCACycfc"(%T11alloc_stack6FoobarC* swiftself)
13+
// CHECK: alloca %TSb, align 1
1314
// CHECK-NOT: store{{.*}}opaque
1415
// CHECK: ret {{.*}}%0
1516
// CHECK:}

test/IRGen/associated_type_witness.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ struct Fulfilled<T : P & Q> : Assocked {
6969
// CHECK-NEXT: [[T3:%.*]] = call swiftcc %swift.metadata_response @swift_checkMetadataState(i64 %0, %swift.type* [[T2]])
7070
// CHECK-NEXT: [[CHECKED:%.*]] = extractvalue %swift.metadata_response [[T3]], 0
7171
// CHECK-NEXT: [[STATE:%.*]] = extractvalue %swift.metadata_response [[T3]], 1
72-
// CHECK-NEXT: [[T3:%.*]] = insertvalue %swift.metadata_response undef, %swift.type* [[CHECKED]], 0
72+
// CHECK: [[T3:%.*]] = insertvalue %swift.metadata_response undef, %swift.type* [[CHECKED]], 0
7373
// CHECK-NEXT: [[T4:%.*]] = insertvalue %swift.metadata_response [[T3]], i64 [[STATE]], 1
7474
// CHECK-NEXT: ret %swift.metadata_response [[T4]]
7575

@@ -142,7 +142,7 @@ struct Computed<T, U> : Assocked {
142142
// CHECK: [[T0:%.*]] = bitcast %swift.type* %"Computed<T, U>" to %swift.type**
143143
// CHECK-NEXT: [[T1:%.*]] = getelementptr inbounds %swift.type*, %swift.type** [[T0]], i64 3
144144
// CHECK-NEXT: [[U:%.*]] = load %swift.type*, %swift.type** [[T1]], align 8, !invariant.load
145-
// CHECK-NEXT: [[T0:%.*]] = call swiftcc %swift.metadata_response @"$S23associated_type_witness4PairVMa"(i64 %0, %swift.type* [[T]], %swift.type* [[U]])
145+
// CHECK: [[T0:%.*]] = call swiftcc %swift.metadata_response @"$S23associated_type_witness4PairVMa"(i64 %0, %swift.type* [[T]], %swift.type* [[U]])
146146
// CHECK-NEXT: [[FETCH_RESULT]] = extractvalue %swift.metadata_response [[T0]], 0
147147
// CHECK-NEXT: [[FETCH_STATE]] = extractvalue %swift.metadata_response [[T0]], 1
148148
// CHECK-NEXT: [[COMPLETE:%.*]] = icmp eq i64 [[FETCH_STATE]], 0

test/IRGen/associated_types.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ func testFastRuncible<T: Runcible, U: FastRuncible>(_ t: T, u: U)
8080
// CHECK-NEXT: [[T1:%.*]] = bitcast i8* [[T0]] to %swift.metadata_response ([[INT]], %swift.type*, i8**)*
8181
// CHECK-NEXT: [[T2:%.*]] = call swiftcc %swift.metadata_response [[T1]]([[INT]] 0, %swift.type* %T, i8** %T.Runcible)
8282
// CHECK-NEXT: %T.RuncerType = extractvalue %swift.metadata_response [[T2]], 0
83+
// CHECK-NEXT: store %swift.type*
8384
// 2. Get the witness table for U.RuncerType.Runcee : Speedy
8485
// 2a. Get the protocol witness table for U.RuncerType : FastRuncer.
8586
// CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds i8*, i8** %U.FastRuncible, i32 2
@@ -92,6 +93,7 @@ func testFastRuncible<T: Runcible, U: FastRuncible>(_ t: T, u: U)
9293
// CHECK-NEXT: [[T1:%.*]] = bitcast i8* [[T0]] to %swift.metadata_response ([[INT]], %swift.type*, i8**)*
9394
// CHECK-NEXT: [[T2:%.*]] = call swiftcc %swift.metadata_response [[T1]]([[INT]] 0, %swift.type* %T.RuncerType, i8** %T.RuncerType.FastRuncer)
9495
// CHECK-NEXT: %T.RuncerType.Runcee = extractvalue %swift.metadata_response [[T2]], 0
96+
// CHECK-NEXT: store %swift.type*
9597
// 2b. Get the witness table for U.RuncerType.Runcee : Speedy.
9698
// CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds i8*, i8** %T.RuncerType.FastRuncer, i32 2
9799
// CHECK-NEXT: [[T1:%.*]] = load i8*, i8** [[T0]],

test/IRGen/builtins.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -819,6 +819,8 @@ func unsafeGuaranteed_test(_ x: Builtin.NativeObject) -> Builtin.NativeObject {
819819

820820
// CHECK-LABEL: define {{.*}} @{{.*}}unsafeGuaranteedEnd_test
821821
// CHECK-NEXT: {{.*}}:
822+
// CHECK-NEXT: alloca
823+
// CHECK-NEXT: store
822824
// CHECK-NEXT: ret void
823825
func unsafeGuaranteedEnd_test(_ x: Builtin.Int8) {
824826
Builtin.unsafeGuaranteedEnd(x)
@@ -849,9 +851,8 @@ func atomicload(_ p: Builtin.RawPointer) {
849851
}
850852

851853
// CHECK-LABEL: define {{.*}} @"$S8builtins14stringObjectOryS2u_SutF"(i64, i64)
852-
// CHECK-NEXT: {{.*}}:
853-
// CHECK-NEXT: %2 = or i64 %0, %1
854-
// CHECK-NEXT: ret i64 %2
854+
// CHECK: %4 = or i64 %0, %1
855+
// CHECK-NEXT: ret i64 %4
855856
func stringObjectOr(_ x: UInt, _ y: UInt) -> UInt {
856857
return UInt(Builtin.stringObjectOr_Int64(
857858
x._value, y._value))

test/IRGen/class_bounded_generics.swift

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -284,11 +284,11 @@ func takes_metatype<T>(_: T.Type) {}
284284
// CHECK-LABEL: define hidden swiftcc void @"$S22class_bounded_generics023archetype_with_generic_A11_constraint1tyx_tAA1ACyq_GRbzr0_lF"(%T22class_bounded_generics1AC.1*, %swift.type* %T)
285285
// CHECK: [[ISA_ADDR:%.*]] = bitcast %T22class_bounded_generics1AC.1* %0 to %swift.type**
286286
// CHECK-NEXT: [[ISA:%.*]] = load %swift.type*, %swift.type** [[ISA_ADDR]]
287-
// CHECK-NEXT: call swiftcc void @"$S22class_bounded_generics14takes_metatypeyyxmlF"(%swift.type* %T, %swift.type* %T)
287+
// CHECK: call swiftcc void @"$S22class_bounded_generics14takes_metatypeyyxmlF"(%swift.type* %T, %swift.type* %T)
288288
// CHECK-NEXT: [[ISA_PTR:%.*]] = bitcast %swift.type* [[ISA]] to %swift.type**
289289
// CHECK-NEXT: [[U_ADDR:%.*]] = getelementptr inbounds %swift.type*, %swift.type** [[ISA_PTR]], i64 10
290290
// CHECK-NEXT: [[U:%.*]] = load %swift.type*, %swift.type** [[U_ADDR]]
291-
// CHECK-NEXT: call swiftcc void @"$S22class_bounded_generics14takes_metatypeyyxmlF"(%swift.type* %U, %swift.type* %U)
291+
// CHECK: call swiftcc void @"$S22class_bounded_generics14takes_metatypeyyxmlF"(%swift.type* %U, %swift.type* %U)
292292
// CHECK: ret void
293293

294294
func archetype_with_generic_class_constraint<T, U>(t: T) where T : A<U> {
@@ -297,12 +297,14 @@ func archetype_with_generic_class_constraint<T, U>(t: T) where T : A<U> {
297297
}
298298

299299
// CHECK-LABEL: define hidden swiftcc void @"$S22class_bounded_generics029calls_archetype_with_generic_A11_constraint1ayAA1ACyxG_tlF"(%T22class_bounded_generics1AC*) #0 {
300+
// CHECK: alloca
301+
// CHECK: store
300302
// CHECK: [[ISA_ADDR:%.*]] = getelementptr inbounds %T22class_bounded_generics1AC, %T22class_bounded_generics1AC* %0, i32 0, i32 0, i32 0
301303
// CHECK-NEXT: [[ISA:%.*]] = load %swift.type*, %swift.type** [[ISA_ADDR]]
302-
// CHECK: [[SELF:%.*]] = bitcast %T22class_bounded_generics1AC* %0 to %T22class_bounded_generics1AC.1*
303-
// CHECK-NEXT: [[ISA_PTR:%.*]] = bitcast %swift.type* [[ISA]] to %swift.type**
304+
// CHECK: [[ISA_PTR:%.*]] = bitcast %swift.type* [[ISA]] to %swift.type**
304305
// CHECK-NEXT: [[T_ADDR:%.*]] = getelementptr inbounds %swift.type*, %swift.type** [[ISA_PTR]], i64 10
305306
// CHECK-NEXT: [[T:%.*]] = load %swift.type*, %swift.type** [[T_ADDR]]
307+
// CHECK: [[SELF:%.*]] = bitcast %T22class_bounded_generics1AC* %0 to %T22class_bounded_generics1AC.1*
306308
// CHECK-NEXT: [[T0:%.*]] = call swiftcc %swift.metadata_response @"$S22class_bounded_generics1ACMa"([[INT]] 0, %swift.type* [[T]])
307309
// CHECK-NEXT: [[A_OF_T:%.*]] = extractvalue %swift.metadata_response [[T0]], 0
308310
// CHECK-NEXT: call swiftcc void @"$S22class_bounded_generics023archetype_with_generic_A11_constraint1tyx_tAA1ACyq_GRbzr0_lF"(%T22class_bounded_generics1AC.1* [[SELF]], %swift.type* [[A_OF_T]])

0 commit comments

Comments
 (0)