Skip to content

Commit 3db28e5

Browse files
authored
Merge pull request #18220 from davezarzycki/add_missing_wv_sym
[IRGen & Runtime] Remove prefab'ed VWT for reference storage types
2 parents 7d777f7 + a5050f5 commit 3db28e5

File tree

6 files changed

+64
-132
lines changed

6 files changed

+64
-132
lines changed

include/swift/Demangling/ManglingMacros.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,6 @@
6666
#define VALUE_WITNESS_SYM(Ty) \
6767
MANGLE_SYM(MANGLING_CONCAT2(Ty, WV))
6868

69-
#define UNOWNED_VALUE_WITNESS_SYM(Ty) \
70-
MANGLE_SYM(MANGLING_CONCAT3(Ty, Xo, WV))
71-
72-
#define WEAK_VALUE_WITNESS_SYM(Ty) \
73-
MANGLE_SYM(MANGLING_CONCAT3(OPTIONAL_MANGLING(Ty), Xw, WV))
74-
7569
#define METATYPE_VALUE_WITNESS_SYM(Ty) \
7670
MANGLE_SYM(MANGLING_CONCAT3(Ty, METATYPE_MANGLING, WV))
7771

include/swift/Runtime/Metadata.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -239,10 +239,6 @@ const ValueWitnessTable VALUE_WITNESS_SYM(Bi512_); // Builtin.Int512
239239
// pointer types.
240240
SWIFT_RUNTIME_EXPORT
241241
const ExtraInhabitantsValueWitnessTable VALUE_WITNESS_SYM(Bo); // Builtin.NativeObject
242-
SWIFT_RUNTIME_EXPORT
243-
const ExtraInhabitantsValueWitnessTable UNOWNED_VALUE_WITNESS_SYM(Bo); // unowned Builtin.NativeObject
244-
SWIFT_RUNTIME_EXPORT
245-
const ValueWitnessTable WEAK_VALUE_WITNESS_SYM(Bo); // weak Builtin.NativeObject?
246242

247243
SWIFT_RUNTIME_EXPORT
248244
const ExtraInhabitantsValueWitnessTable VALUE_WITNESS_SYM(Bb); // Builtin.BridgeObject
@@ -254,10 +250,6 @@ const ExtraInhabitantsValueWitnessTable VALUE_WITNESS_SYM(Bp); // Builtin.RawPoi
254250
// The ObjC-pointer table can be used for arbitrary ObjC pointer types.
255251
SWIFT_RUNTIME_EXPORT
256252
const ExtraInhabitantsValueWitnessTable VALUE_WITNESS_SYM(BO); // Builtin.UnknownObject
257-
SWIFT_RUNTIME_EXPORT
258-
const ExtraInhabitantsValueWitnessTable UNOWNED_VALUE_WITNESS_SYM(BO); // unowned Builtin.UnknownObject
259-
SWIFT_RUNTIME_EXPORT
260-
const ValueWitnessTable WEAK_VALUE_WITNESS_SYM(BO); // weak Builtin.UnknownObject?
261253
#endif
262254

263255
// The () -> () table can be used for arbitrary function types.

lib/IRGen/GenExistential.cpp

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -247,9 +247,9 @@ namespace {
247247

248248
using super::asDerived;
249249
using super::emitCopyOfTables;
250-
using super::getNumStoredProtocols;
251250

252251
protected:
252+
using super::getNumStoredProtocols;
253253
const ReferenceCounting Refcounting;
254254

255255
template <class... As>
@@ -618,13 +618,13 @@ namespace {
618618
};
619619

620620
/// A type implementation for existential types.
621-
#define LOADABLE_REF_STORAGE_HELPER(Name) \
621+
#define REF_STORAGE_HELPER(Name, Super) \
622622
private: \
623623
bool shouldStoreExtraInhabitantsInRef(IRGenModule &IGM) const { \
624-
if (getNumStoredProtocols() == 0) \
624+
if (IGM.getReferenceStorageExtraInhabitantCount( \
625+
ReferenceOwnership::Name, Refcounting) > 1) \
625626
return true; \
626-
return IGM.getReferenceStorageExtraInhabitantCount( \
627-
ReferenceOwnership::Name, Refcounting) > 1; \
627+
return getNumStoredProtocols() == 0; \
628628
} \
629629
public: \
630630
bool mayHaveExtraInhabitants(IRGenModule &IGM) const override { \
@@ -635,7 +635,7 @@ namespace {
635635
return IGM.getReferenceStorageExtraInhabitantCount( \
636636
ReferenceOwnership::Name, Refcounting) - IsOptional; \
637637
} else { \
638-
return LoadableTypeInfo::getFixedExtraInhabitantCount(IGM); \
638+
return Super::getFixedExtraInhabitantCount(IGM); \
639639
} \
640640
} \
641641
APInt getFixedExtraInhabitantValue(IRGenModule &IGM, \
@@ -647,8 +647,7 @@ namespace {
647647
ReferenceOwnership::Name, \
648648
Refcounting); \
649649
} else { \
650-
return LoadableTypeInfo::getFixedExtraInhabitantValue(IGM, \
651-
bits, index); \
650+
return Super::getFixedExtraInhabitantValue(IGM, bits, index); \
652651
} \
653652
} \
654653
llvm::Value *getExtraInhabitantIndex(IRGenFunction &IGF, Address src, \
@@ -658,7 +657,7 @@ namespace {
658657
return IGF.getReferenceStorageExtraInhabitantIndex(valueSrc, \
659658
ReferenceOwnership::Name, Refcounting); \
660659
} else { \
661-
return LoadableTypeInfo::getExtraInhabitantIndex(IGF, src, T); \
660+
return Super::getExtraInhabitantIndex(IGF, src, T); \
662661
} \
663662
} \
664663
void storeExtraInhabitant(IRGenFunction &IGF, llvm::Value *index, \
@@ -668,7 +667,7 @@ namespace {
668667
return IGF.storeReferenceStorageExtraInhabitant(index, valueDest, \
669668
ReferenceOwnership::Name, Refcounting); \
670669
} else { \
671-
return LoadableTypeInfo::storeExtraInhabitant(IGF, index, dest, T); \
670+
return Super::storeExtraInhabitant(IGF, index, dest, T); \
672671
} \
673672
} \
674673
APInt getFixedExtraInhabitantMask(IRGenModule &IGM) const override { \
@@ -680,14 +679,15 @@ namespace {
680679
bits = bits.zextOrTrunc(getFixedSize().getValueInBits()); \
681680
return bits; \
682681
} else { \
683-
return LoadableTypeInfo::getFixedExtraInhabitantMask(IGM); \
682+
return Super::getFixedExtraInhabitantMask(IGM); \
684683
} \
685684
}
686685
#define NEVER_LOADABLE_CHECKED_REF_STORAGE(Name, name, ...) \
687686
class AddressOnly##Name##ClassExistentialTypeInfo final : \
688687
public AddressOnlyClassExistentialTypeInfoBase< \
689688
AddressOnly##Name##ClassExistentialTypeInfo, \
690689
FixedTypeInfo> { \
690+
bool IsOptional; \
691691
public: \
692692
AddressOnly##Name##ClassExistentialTypeInfo( \
693693
ArrayRef<ProtocolEntry> protocols, \
@@ -700,7 +700,8 @@ namespace {
700700
ty, size, std::move(spareBits), \
701701
align, IsNotPOD, \
702702
IsNotBitwiseTakable, \
703-
IsFixedSize) {} \
703+
IsFixedSize), \
704+
IsOptional(isOptional) {} \
704705
void emitValueAssignWithCopy(IRGenFunction &IGF, \
705706
Address dest, Address src) const { \
706707
IGF.emit##Name##CopyAssign(dest, src, Refcounting); \
@@ -721,6 +722,7 @@ namespace {
721722
IGF.emit##Name##Destroy(addr, Refcounting); \
722723
} \
723724
StringRef getStructNameSuffix() const { return "." #name "ref"; } \
725+
REF_STORAGE_HELPER(Name, FixedTypeInfo) \
724726
};
725727
#define ALWAYS_LOADABLE_CHECKED_REF_STORAGE(Name, ...) \
726728
class Loadable##Name##ClassExistentialTypeInfo final \
@@ -767,7 +769,7 @@ namespace {
767769
getValueTypeInfoForExtraInhabitants(IRGenModule &IGM) const { \
768770
llvm_unreachable("should have overridden all actual uses of this"); \
769771
} \
770-
LOADABLE_REF_STORAGE_HELPER(Name) \
772+
REF_STORAGE_HELPER(Name, LoadableTypeInfo) \
771773
};
772774
#define SOMETIMES_LOADABLE_CHECKED_REF_STORAGE(Name, name, ...) \
773775
NEVER_LOADABLE_CHECKED_REF_STORAGE(Name, name, "...") \
@@ -794,16 +796,16 @@ namespace {
794796
else \
795797
return IGM.getUnknownObjectTypeInfo(); \
796798
} \
797-
/* FIXME -- Use LOADABLE_REF_STORAGE_HELPER and make */ \
798-
/* getValueTypeInfoForExtraInhabitantsThis call llvm_unreachable() */ \
799+
/* FIXME -- Use REF_STORAGE_HELPER and make */ \
800+
/* getValueTypeInfoForExtraInhabitants call llvm_unreachable() */ \
799801
void emitValueRetain(IRGenFunction &IGF, llvm::Value *value, \
800802
Atomicity atomicity) const {} \
801803
void emitValueRelease(IRGenFunction &IGF, llvm::Value *value, \
802804
Atomicity atomicity) const {} \
803805
void emitValueFixLifetime(IRGenFunction &IGF, llvm::Value *value) const {} \
804806
};
805807
#include "swift/AST/ReferenceStorage.def"
806-
#undef LOADABLE_REF_STORAGE_HELPER
808+
#undef REF_STORAGE_HELPER
807809
} // end anonymous namespace
808810

809811

lib/IRGen/MetadataRequest.cpp

Lines changed: 0 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -2310,70 +2310,6 @@ namespace {
23102310
DynamicMetadataRequest request) {
23112311
return visitAnyClassType(type->getClassOrBoundGenericClass(), request);
23122312
}
2313-
2314-
llvm::Value *visitReferenceStorageType(CanReferenceStorageType type,
2315-
DynamicMetadataRequest request) {
2316-
// Other reference storage types all have the same layout for their
2317-
// storage qualification and the reference counting of their underlying
2318-
// object.
2319-
2320-
auto &C = IGF.IGM.Context;
2321-
CanType referent = type.getReferentType();
2322-
CanType underlyingTy = referent;
2323-
if (auto Ty = referent.getOptionalObjectType())
2324-
underlyingTy = Ty;
2325-
2326-
// Reference storage types with witness tables need open-coded layouts.
2327-
// TODO: Maybe we could provide prefabs for 1 witness table.
2328-
if (underlyingTy.isExistentialType()) {
2329-
auto layout = underlyingTy.getExistentialLayout();
2330-
for (auto *protoTy : layout.getProtocols()) {
2331-
auto *protoDecl = protoTy->getDecl();
2332-
if (IGF.getSILTypes().protocolRequiresWitnessTable(protoDecl))
2333-
return visitType(type, request);
2334-
}
2335-
}
2336-
2337-
// Unmanaged references are plain pointers with extra inhabitants,
2338-
// which look like thick metatypes.
2339-
//
2340-
// FIXME: This sounds wrong, an Objective-C tagged pointer could be
2341-
// stored in an unmanaged reference for instance.
2342-
if (type->getOwnership() == ReferenceOwnership::Unmanaged) {
2343-
auto metatype = CanMetatypeType::get(C.TheNativeObjectType);
2344-
return emitFromValueWitnessTable(metatype);
2345-
}
2346-
2347-
CanType valueWitnessReferent;
2348-
switch (getReferenceCountingForType(IGF.IGM, underlyingTy)) {
2349-
case ReferenceCounting::Unknown:
2350-
case ReferenceCounting::Block:
2351-
case ReferenceCounting::ObjC:
2352-
valueWitnessReferent = C.TheUnknownObjectType;
2353-
break;
2354-
2355-
case ReferenceCounting::Native:
2356-
valueWitnessReferent = C.TheNativeObjectType;
2357-
break;
2358-
2359-
case ReferenceCounting::Bridge:
2360-
valueWitnessReferent = C.TheBridgeObjectType;
2361-
break;
2362-
2363-
case ReferenceCounting::Error:
2364-
llvm_unreachable("shouldn't be possible");
2365-
}
2366-
2367-
// Get the reference storage type of the builtin object whose value
2368-
// witness we can borrow.
2369-
if (referent->getOptionalObjectType())
2370-
valueWitnessReferent = OptionalType::get(valueWitnessReferent)
2371-
->getCanonicalType();
2372-
2373-
auto valueWitnessType = CanReferenceStorageType::get(valueWitnessReferent,
2374-
type->getOwnership());
2375-
return emitFromValueWitnessTable(valueWitnessType);
2376-
}
23772313
};
23782314

23792315
} // end anonymous namespace

stdlib/public/runtime/KnownMetadata.cpp

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,6 @@ const ValueWitnessTable swift::VALUE_WITNESS_SYM(Bi512_) =
6767
const ExtraInhabitantsValueWitnessTable swift::VALUE_WITNESS_SYM(Bo) =
6868
ValueWitnessTableForBox<SwiftRetainableBox>::table;
6969

70-
/// The basic value-witness table for Swift unowned pointers.
71-
const ExtraInhabitantsValueWitnessTable swift::UNOWNED_VALUE_WITNESS_SYM(Bo) =
72-
ValueWitnessTableForBox<SwiftUnownedRetainableBox>::table;
73-
74-
/// The basic value-witness table for Swift weak pointers.
75-
const ValueWitnessTable swift::WEAK_VALUE_WITNESS_SYM(Bo) =
76-
ValueWitnessTableForBox<SwiftWeakRetainableBox>::table;
77-
7870
/// The value-witness table for pointer-aligned unmanaged pointer types.
7971
const ExtraInhabitantsValueWitnessTable swift::METATYPE_VALUE_WITNESS_SYM(Bo) =
8072
ValueWitnessTableForBox<PointerPointerBox>::table;
@@ -103,14 +95,6 @@ static const ValueWitnessTable VALUE_WITNESS_SYM(BB) =
10395
const ExtraInhabitantsValueWitnessTable swift::VALUE_WITNESS_SYM(BO) =
10496
ValueWitnessTableForBox<ObjCRetainableBox>::table;
10597

106-
/// The basic value-witness table for ObjC unowned pointers.
107-
const ExtraInhabitantsValueWitnessTable swift::UNOWNED_VALUE_WITNESS_SYM(BO) =
108-
ValueWitnessTableForBox<ObjCUnownedRetainableBox>::table;
109-
110-
/// The basic value-witness table for ObjC weak pointers.
111-
const ValueWitnessTable swift::WEAK_VALUE_WITNESS_SYM(BO) =
112-
ValueWitnessTableForBox<ObjCWeakRetainableBox>::table;
113-
11498
#endif
11599

116100
/*** Functions ***************************************************************/

test/IRGen/type_layout_reference_storage.swift

Lines changed: 46 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -11,32 +11,44 @@ struct ReferenceStorageTypeLayout<T, Native : C, Unknown : AnyObject> {
1111
var z: T
1212

1313
// -- Known-Swift-refcounted type
14-
// CHECK: store i8** getelementptr inbounds (i8*, i8** @"$SBoXoWV", i32 8)
15-
unowned(safe) var cs: C
16-
// CHECK: store i8** getelementptr inbounds (i8*, i8** @"$SBomWV", i32 8)
14+
// CHECK-64: store i8** getelementptr inbounds ([4 x i8*], [4 x i8*]* @type_layout_8_8_[[REF_XI:[0-9a-f][0-9a-f][0-9a-f]+]]_pod, i32 0, i32 0)
15+
// CHECK-32: store i8** getelementptr inbounds ([4 x i8*], [4 x i8*]* @type_layout_4_4_[[REF_XI:[0-9a-f][0-9a-f][0-9a-f]+]]_pod, i32 0, i32 0)
1716
unowned(unsafe) var cu: C
18-
// CHECK: store i8** getelementptr inbounds (i8*, i8** @"$SBoSgXwWV", i32 8)
17+
// CHECK-native-64: store i8** getelementptr inbounds ([4 x i8*], [4 x i8*]* @type_layout_8_8_[[REF_XI]]_bt, i32 0, i32 0)
18+
// CHECK-objc-64: store i8** getelementptr inbounds ([4 x i8*], [4 x i8*]* @type_layout_8_8_1_bt, i32 0, i32 0)
19+
// CHECK-native-32: store i8** getelementptr inbounds ([4 x i8*], [4 x i8*]* @type_layout_4_4_[[REF_XI]]_bt, i32 0, i32 0)
20+
// CHECK-objc-32: store i8** getelementptr inbounds ([4 x i8*], [4 x i8*]* @type_layout_4_4_1_bt, i32 0, i32 0)
21+
unowned(safe) var cs: C
22+
// CHECK-64: store i8** getelementptr inbounds ([3 x i8*], [3 x i8*]* @type_layout_8_8_0, i32 0, i32 0)
23+
// CHECK-32: store i8** getelementptr inbounds ([3 x i8*], [3 x i8*]* @type_layout_4_4_0, i32 0, i32 0)
1924
weak var cwo: C?
20-
// CHECK: store i8** getelementptr inbounds (i8*, i8** @"$SBoSgXwWV", i32 8)
25+
// CHECK-64: store i8** getelementptr inbounds ([3 x i8*], [3 x i8*]* @type_layout_8_8_0, i32 0, i32 0)
26+
// CHECK-32: store i8** getelementptr inbounds ([3 x i8*], [3 x i8*]* @type_layout_4_4_0, i32 0, i32 0)
2127
weak var cwi: C!
2228

2329
// -- Known-Swift-refcounted archetype
24-
// CHECK: store i8** getelementptr inbounds (i8*, i8** @"$SBoXoWV", i32 8)
25-
unowned(safe) var nc: Native
26-
// CHECK: store i8** getelementptr inbounds (i8*, i8** @"$SBomWV", i32 8)
30+
// CHECK-64: store i8** getelementptr inbounds ([4 x i8*], [4 x i8*]* @type_layout_8_8_[[REF_XI]]_pod, i32 0, i32 0)
31+
// CHECK-32: store i8** getelementptr inbounds ([4 x i8*], [4 x i8*]* @type_layout_4_4_[[REF_XI]]_pod, i32 0, i32 0)
2732
unowned(unsafe) var nu: Native
28-
// CHECK: store i8** getelementptr inbounds (i8*, i8** @"$SBoSgXwWV", i32 8)
33+
// CHECK-native-64: store i8** getelementptr inbounds ([4 x i8*], [4 x i8*]* @type_layout_8_8_[[REF_XI]]_bt, i32 0, i32 0)
34+
// CHECK-objc-64: store i8** getelementptr inbounds ([4 x i8*], [4 x i8*]* @type_layout_8_8_1_bt, i32 0, i32 0)
35+
// CHECK-native-32: store i8** getelementptr inbounds ([4 x i8*], [4 x i8*]* @type_layout_4_4_[[REF_XI]]_bt, i32 0, i32 0)
36+
// CHECK-objc-32: store i8** getelementptr inbounds ([4 x i8*], [4 x i8*]* @type_layout_4_4_1_bt, i32 0, i32 0)
37+
unowned(safe) var nc: Native
38+
// CHECK-64: store i8** getelementptr inbounds ([3 x i8*], [3 x i8*]* @type_layout_8_8_0, i32 0, i32 0)
39+
// CHECK-32: store i8** getelementptr inbounds ([3 x i8*], [3 x i8*]* @type_layout_4_4_0, i32 0, i32 0)
2940
weak var nwo: Native?
30-
// CHECK: store i8** getelementptr inbounds (i8*, i8** @"$SBoSgXwWV", i32 8)
41+
// CHECK-64: store i8** getelementptr inbounds ([3 x i8*], [3 x i8*]* @type_layout_8_8_0, i32 0, i32 0)
42+
// CHECK-32: store i8** getelementptr inbounds ([3 x i8*], [3 x i8*]* @type_layout_4_4_0, i32 0, i32 0)
3143
weak var nwi: Native!
3244

3345
// -- Open-code layout for protocol types with witness tables. Note:
3446
// 1) The layouts for unowned(safe) references are only bitwise takable
3547
// when ObjC interop is disabled.
3648
// 2) 0x7fffffff is the max extra inhabitant count, but not all types in
3749
// all scenarios.
38-
// CHECK-64: store i8** getelementptr inbounds ([4 x i8*], [4 x i8*]* @type_layout_16_8_[[REF_XI:[0-9a-f][0-9a-f][0-9a-f]+]]_pod, i32 0, i32 0)
39-
// CHECK-32: store i8** getelementptr inbounds ([4 x i8*], [4 x i8*]* @type_layout_8_4_[[REF_XI:[0-9a-f][0-9a-f][0-9a-f]+]]_pod, i32 0, i32 0)
50+
// CHECK-64: store i8** getelementptr inbounds ([4 x i8*], [4 x i8*]* @type_layout_16_8_[[REF_XI]]_pod, i32 0, i32 0)
51+
// CHECK-32: store i8** getelementptr inbounds ([4 x i8*], [4 x i8*]* @type_layout_8_4_[[REF_XI]]_pod, i32 0, i32 0)
4052
unowned(unsafe) var pu: P
4153
// CHECK-native-64: store i8** getelementptr inbounds ([4 x i8*], [4 x i8*]* @type_layout_16_8_[[REF_XI]]_bt, i32 0, i32 0)
4254
// CHECK-objc-64: store i8** getelementptr inbounds ([4 x i8*], [4 x i8*]* @type_layout_16_8_7fffffff, i32 0, i32 0)
@@ -81,23 +93,35 @@ struct ReferenceStorageTypeLayout<T, Native : C, Unknown : AnyObject> {
8193
weak var pqcwi: (P & Q & C)!
8294

8395
// -- Unknown-refcounted existential without witness tables.
84-
// CHECK: store i8** getelementptr inbounds (i8*, i8** @"$S[[UNKNOWN:B[Oo]]]XoWV", i32 8)
85-
unowned(safe) var aos: AnyObject
86-
// CHECK: store i8** getelementptr inbounds (i8*, i8** @"$SBomWV", i32 8)
96+
// CHECK-64: store i8** getelementptr inbounds ([4 x i8*], [4 x i8*]* @type_layout_8_8_[[REF_XI]]_pod, i32 0, i32 0)
97+
// CHECK-32: store i8** getelementptr inbounds ([4 x i8*], [4 x i8*]* @type_layout_4_4_[[REF_XI]]_pod, i32 0, i32 0)
8798
unowned(unsafe) var aou: AnyObject
88-
// CHECK: store i8** getelementptr inbounds (i8*, i8** @"$S[[UNKNOWN]]SgXwWV", i32 8)
99+
// CHECK-native-64: store i8** getelementptr inbounds ([4 x i8*], [4 x i8*]* @type_layout_8_8_[[REF_XI]]_bt, i32 0, i32 0)
100+
// CHECK-objc-64: store i8** getelementptr inbounds ([4 x i8*], [4 x i8*]* @type_layout_8_8_1, i32 0, i32 0)
101+
// CHECK-native-32: store i8** getelementptr inbounds ([4 x i8*], [4 x i8*]* @type_layout_4_4_[[REF_XI]]_bt, i32 0, i32 0)
102+
// CHECK-objc-32: store i8** getelementptr inbounds ([4 x i8*], [4 x i8*]* @type_layout_4_4_1, i32 0, i32 0)
103+
unowned(safe) var aos: AnyObject
104+
// CHECK-64: store i8** getelementptr inbounds ([3 x i8*], [3 x i8*]* @type_layout_8_8_0, i32 0, i32 0)
105+
// CHECK-32: store i8** getelementptr inbounds ([3 x i8*], [3 x i8*]* @type_layout_4_4_0, i32 0, i32 0)
89106
weak var aowo: AnyObject?
90-
// CHECK: store i8** getelementptr inbounds (i8*, i8** @"$S[[UNKNOWN]]SgXwWV", i32 8)
107+
// CHECK-64: store i8** getelementptr inbounds ([3 x i8*], [3 x i8*]* @type_layout_8_8_0, i32 0, i32 0)
108+
// CHECK-32: store i8** getelementptr inbounds ([3 x i8*], [3 x i8*]* @type_layout_4_4_0, i32 0, i32 0)
91109
weak var aowi: AnyObject!
92110

93111
// -- Unknown-refcounted archetype
94-
// CHECK: store i8** getelementptr inbounds (i8*, i8** @"$S[[UNKNOWN:B[Oo]]]XoWV", i32 8)
95-
unowned(safe) var us: Unknown
96-
// CHECK: store i8** getelementptr inbounds (i8*, i8** @"$SBomWV", i32 8)
112+
// CHECK-64: store i8** getelementptr inbounds ([4 x i8*], [4 x i8*]* @type_layout_8_8_[[REF_XI]]_pod, i32 0, i32 0)
113+
// CHECK-32: store i8** getelementptr inbounds ([4 x i8*], [4 x i8*]* @type_layout_4_4_[[REF_XI]]_pod, i32 0, i32 0)
97114
unowned(unsafe) var uu: Unknown
98-
// CHECK: store i8** getelementptr inbounds (i8*, i8** @"$S[[UNKNOWN]]SgXwWV", i32 8)
115+
// CHECK-native-64: store i8** getelementptr inbounds ([4 x i8*], [4 x i8*]* @type_layout_8_8_[[REF_XI]]_bt, i32 0, i32 0)
116+
// CHECK-objc-64: store i8** getelementptr inbounds ([4 x i8*], [4 x i8*]* @type_layout_8_8_1, i32 0, i32 0)
117+
// CHECK-native-32: store i8** getelementptr inbounds ([4 x i8*], [4 x i8*]* @type_layout_4_4_[[REF_XI]]_bt, i32 0, i32 0)
118+
// CHECK-objc-32: store i8** getelementptr inbounds ([4 x i8*], [4 x i8*]* @type_layout_4_4_1, i32 0, i32 0)
119+
unowned(safe) var us: Unknown
120+
// CHECK-64: store i8** getelementptr inbounds ([3 x i8*], [3 x i8*]* @type_layout_8_8_0, i32 0, i32 0)
121+
// CHECK-32: store i8** getelementptr inbounds ([3 x i8*], [3 x i8*]* @type_layout_4_4_0, i32 0, i32 0)
99122
weak var uwo: Unknown?
100-
// CHECK: store i8** getelementptr inbounds (i8*, i8** @"$S[[UNKNOWN]]SgXwWV", i32 8)
123+
// CHECK-64: store i8** getelementptr inbounds ([3 x i8*], [3 x i8*]* @type_layout_8_8_0, i32 0, i32 0)
124+
// CHECK-32: store i8** getelementptr inbounds ([3 x i8*], [3 x i8*]* @type_layout_4_4_0, i32 0, i32 0)
101125
weak var uwi: Unknown!
102126
}
103127

0 commit comments

Comments
 (0)