From 6a23ed54384ba8249a352094858ad5bcef490e00 Mon Sep 17 00:00:00 2001 From: Arnold Schwaighofer Date: Wed, 2 Oct 2019 06:46:31 -0700 Subject: [PATCH] Revert "IRGen: Leave frame pointers off SIL functions marked [thunk]." This reverts commit b3ac66aeebd033a5957745afc138c56569dc1d13. This is problematic when [thunk] functions get inlined into and the function from which we inline expects a framepointer. Specifically, _swift_os_log_return_address() reads the framepointer. rdar://55852225 --- lib/IRGen/IRGenSIL.cpp | 3 --- test/IRGen/associated_types.swift | 2 +- test/IRGen/class_bounded_generics.swift | 2 +- test/IRGen/class_resilience.swift | 2 +- test/IRGen/generic_metatypes.swift | 4 ++-- test/IRGen/objc_super.swift | 2 +- test/IRGen/partial_apply_generic.swift | 2 +- test/ModuleInterface/private-stored-member-type-layout.swift | 2 +- 8 files changed, 8 insertions(+), 11 deletions(-) diff --git a/lib/IRGen/IRGenSIL.cpp b/lib/IRGen/IRGenSIL.cpp index 84bef14650576..46f0183dfd858 100644 --- a/lib/IRGen/IRGenSIL.cpp +++ b/lib/IRGen/IRGenSIL.cpp @@ -1639,9 +1639,6 @@ void IRGenSILFunction::emitSILFunction() { assert(!CurSILFn->empty() && "function has no basic blocks?!"); - if (CurSILFn->isThunk()) - IGM.setHasFramePointer(CurFn, false); - if (CurSILFn->getDynamicallyReplacedFunction()) IGM.IRGen.addDynamicReplacement(CurSILFn); diff --git a/test/IRGen/associated_types.swift b/test/IRGen/associated_types.swift index cedfb5d1c013d..85039ee87535a 100644 --- a/test/IRGen/associated_types.swift +++ b/test/IRGen/associated_types.swift @@ -71,7 +71,7 @@ func testFastRuncible(_ t: T, u: U) U.RuncerType.Runcee.accelerate() } -// CHECK: define hidden swiftcc void @"$s16associated_types16testFastRuncible_1uyx_q_tAA0E0RzAA0dE0R_10RuncerTypeQy_AFRtzr0_lF"(%swift.opaque* noalias nocapture, %swift.opaque* noalias nocapture, %swift.type* %T, %swift.type* %U, i8** %T.Runcible, i8** %U.FastRuncible) {{.*}} { +// CHECK: define hidden swiftcc void @"$s16associated_types16testFastRuncible_1uyx_q_tAA0E0RzAA0dE0R_10RuncerTypeQy_AFRtzr0_lF"(%swift.opaque* noalias nocapture, %swift.opaque* noalias nocapture, %swift.type* %T, %swift.type* %U, i8** %T.Runcible, i8** %U.FastRuncible) #0 { // 1. Get the type metadata for U.RuncerType.Runcee. // 1a. Get the type metadata for U.RuncerType. // Note that we actually look things up in T, which is going to prove unfortunate. diff --git a/test/IRGen/class_bounded_generics.swift b/test/IRGen/class_bounded_generics.swift index f60709009c4ca..a3ae39429c697 100644 --- a/test/IRGen/class_bounded_generics.swift +++ b/test/IRGen/class_bounded_generics.swift @@ -296,7 +296,7 @@ func archetype_with_generic_class_constraint(t: T) where T : A { takes_metatype(U.self) } -// CHECK-LABEL: define hidden swiftcc void @"$s22class_bounded_generics029calls_archetype_with_generic_A11_constraint1ayAA1ACyxG_tlF"(%T22class_bounded_generics1AC*) {{.*}} { +// CHECK-LABEL: define hidden swiftcc void @"$s22class_bounded_generics029calls_archetype_with_generic_A11_constraint1ayAA1ACyxG_tlF"(%T22class_bounded_generics1AC*) #0 { // CHECK: alloca // CHECK: memset // CHECK: [[ISA_ADDR:%.*]] = getelementptr inbounds %T22class_bounded_generics1AC, %T22class_bounded_generics1AC* %0, i32 0, i32 0, i32 0 diff --git a/test/IRGen/class_resilience.swift b/test/IRGen/class_resilience.swift index 5aae3dffcac4d..1c8960c2bb9ee 100644 --- a/test/IRGen/class_resilience.swift +++ b/test/IRGen/class_resilience.swift @@ -361,7 +361,7 @@ public class ClassWithResilientThenEmpty { // ResilientGenericOutsideParent.genericExtensionMethod() -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc %swift.type* @"$s15resilient_class29ResilientGenericOutsideParentC0B11_resilienceE22genericExtensionMethodxmyF"(%T15resilient_class29ResilientGenericOutsideParentC* swiftself) {{.*}} { +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc %swift.type* @"$s15resilient_class29ResilientGenericOutsideParentC0B11_resilienceE22genericExtensionMethodxmyF"(%T15resilient_class29ResilientGenericOutsideParentC* swiftself) #0 { // CHECK: [[ISA_ADDR:%.*]] = bitcast %T15resilient_class29ResilientGenericOutsideParentC* %0 to %swift.type** // CHECK-NEXT: [[ISA:%.*]] = load %swift.type*, %swift.type** [[ISA_ADDR]] // CHECK: [[BASE:%.*]] = load [[INT]], [[INT]]* getelementptr inbounds ([[BOUNDS]], [[BOUNDS]]* @"$s15resilient_class29ResilientGenericOutsideParentCMo", i32 0, i32 0) diff --git a/test/IRGen/generic_metatypes.swift b/test/IRGen/generic_metatypes.swift index 23e830082d89c..e454e0fd5c6c1 100644 --- a/test/IRGen/generic_metatypes.swift +++ b/test/IRGen/generic_metatypes.swift @@ -77,13 +77,13 @@ func protocolTypeof(_ x: Bas) -> Bas.Type { struct Zim : Bas {} class Zang : Bas {} -// CHECK-LABEL: define hidden swiftcc { %swift.type*, i8** } @"$s17generic_metatypes15metatypeErasureyAA3Bas_pXpAA3ZimVmF"() +// CHECK-LABEL: define hidden swiftcc { %swift.type*, i8** } @"$s17generic_metatypes15metatypeErasureyAA3Bas_pXpAA3ZimVmF"() #0 func metatypeErasure(_ z: Zim.Type) -> Bas.Type { // CHECK: ret { %swift.type*, i8** } {{.*}} @"$s17generic_metatypes3ZimVMf", {{.*}} @"$s17generic_metatypes3ZimVAA3BasAAWP" return z } -// CHECK-LABEL: define hidden swiftcc { %swift.type*, i8** } @"$s17generic_metatypes15metatypeErasureyAA3Bas_pXpAA4ZangCmF"(%swift.type*) +// CHECK-LABEL: define hidden swiftcc { %swift.type*, i8** } @"$s17generic_metatypes15metatypeErasureyAA3Bas_pXpAA4ZangCmF"(%swift.type*) #0 func metatypeErasure(_ z: Zang.Type) -> Bas.Type { // CHECK: [[RET:%.*]] = insertvalue { %swift.type*, i8** } undef, %swift.type* %0, 0 // CHECK: [[RET2:%.*]] = insertvalue { %swift.type*, i8** } [[RET]], i8** getelementptr inbounds ([1 x i8*], [1 x i8*]* @"$s17generic_metatypes4ZangCAA3BasAAWP", i32 0, i32 0), 1 diff --git a/test/IRGen/objc_super.swift b/test/IRGen/objc_super.swift index b0e41743c342f..d04008a877f4a 100644 --- a/test/IRGen/objc_super.swift +++ b/test/IRGen/objc_super.swift @@ -129,7 +129,7 @@ class GenericRuncer : Gizmo { } } -// CHECK: define internal swiftcc void [[PARTIAL_FORWARDING_THUNK]](%swift.refcounted* swiftself) {{.*}} { +// CHECK: define internal swiftcc void [[PARTIAL_FORWARDING_THUNK]](%swift.refcounted* swiftself) #0 { // CHECK: call swiftcc %swift.metadata_response @"$s10objc_super12PartialApplyCMa"([[INT]] 0) // CHECK: @"\01L_selector(frob)" // CHECK: call void bitcast (void ()* @objc_msgSendSuper2 diff --git a/test/IRGen/partial_apply_generic.swift b/test/IRGen/partial_apply_generic.swift index 8b47a6b332ffe..11b0c9ca3b582 100644 --- a/test/IRGen/partial_apply_generic.swift +++ b/test/IRGen/partial_apply_generic.swift @@ -48,7 +48,7 @@ struct S { let s = S() var y = s.hugeStructReturn -// CHECK-LABEL: define internal swiftcc { i64, i64, i64, i64 } @"$s21partial_apply_generic1SV16hugeStructReturnyAA04HugeE0VAFFTA"(i64, i64, i64, i64, %swift.refcounted* swiftself) {{.*}} { +// CHECK-LABEL: define internal swiftcc { i64, i64, i64, i64 } @"$s21partial_apply_generic1SV16hugeStructReturnyAA04HugeE0VAFFTA"(i64, i64, i64, i64, %swift.refcounted* swiftself) #0 { // CHECK: entry: // CHECK: %5 = tail call swiftcc { i64, i64, i64, i64 } @"$s21partial_apply_generic1SV16hugeStructReturnyAA04HugeE0VAFF"(i64 %0, i64 %1, i64 %2, i64 %3) // CHECK: ret { i64, i64, i64, i64 } %5 diff --git a/test/ModuleInterface/private-stored-member-type-layout.swift b/test/ModuleInterface/private-stored-member-type-layout.swift index 69b9d7cdbbb44..daa322604d3f0 100644 --- a/test/ModuleInterface/private-stored-member-type-layout.swift +++ b/test/ModuleInterface/private-stored-member-type-layout.swift @@ -26,7 +26,7 @@ import PrivateStoredMembers #endif -// CHECK-EXEC: swiftcc void @"$s{{[^ ]+}}8makeUseryyF"() {{.*}} { +// CHECK-EXEC: swiftcc void @"$s{{[^ ]+}}8makeUseryyF"() #0 { public func makeUser() { let ptr = UnsafeMutablePointer.allocate(capacity: 1) // CHECK-EXEC: %.publicEndVar = getelementptr inbounds [[MYSTRUCT]], [[MYSTRUCT]]* %{{[0-9]+}}, i32 0, i32 [[PUBLIC_END_VAR_IDX:12]]