@@ -42,8 +42,64 @@ struct lotsoffield {
42
42
init()
43
43
}
44
44
45
+ struct goo {
46
+ var left : foo
47
+ var right : foo
48
+ var top : foo
49
+ var bottom : foo
50
+ }
51
+
45
52
sil @use_Int : $@convention(thin) (Int) -> ()
46
53
54
+
55
+ // CHECK-LABEL: sil [thunk] [always_inline] @argument_with_incomplete_epilogue_release
56
+ // CHECK: [[IN2:%.*]] = struct_extract [[IN1:%.*]] : $goo, #goo.top
57
+ // CHECK: function_ref @_TTSf4g_n___TTSf4s__argument_with_incomplete_epilogue_release : $@convention(thin) (@guaranteed foo, @owned foo) -> ()
58
+ // CHECK: release_value [[IN2]]
59
+ sil @argument_with_incomplete_epilogue_release : $@convention(thin) (@owned goo) -> () {
60
+ bb0(%0 : $goo):
61
+ // make inline costs = 2
62
+ %c1 = builtin "assert_configuration"() : $Builtin.Int32
63
+ %c2 = builtin "assert_configuration"() : $Builtin.Int32
64
+ %c3 = builtin "assert_configuration"() : $Builtin.Int32
65
+ %c4 = builtin "assert_configuration"() : $Builtin.Int32
66
+ %c5 = builtin "assert_configuration"() : $Builtin.Int32
67
+ %c6 = builtin "assert_configuration"() : $Builtin.Int32
68
+ %c7 = builtin "assert_configuration"() : $Builtin.Int32
69
+ %c8 = builtin "assert_configuration"() : $Builtin.Int32
70
+ %c9 = builtin "assert_configuration"() : $Builtin.Int32
71
+ %c10 = builtin "assert_configuration"() : $Builtin.Int32
72
+ %c11 = builtin "assert_configuration"() : $Builtin.Int32
73
+ %c12 = builtin "assert_configuration"() : $Builtin.Int32
74
+ %c13 = builtin "assert_configuration"() : $Builtin.Int32
75
+ %c14 = builtin "assert_configuration"() : $Builtin.Int32
76
+ %c15 = builtin "assert_configuration"() : $Builtin.Int32
77
+ %c16 = builtin "assert_configuration"() : $Builtin.Int32
78
+ %c17 = builtin "assert_configuration"() : $Builtin.Int32
79
+ %c18 = builtin "assert_configuration"() : $Builtin.Int32
80
+ %c19 = builtin "assert_configuration"() : $Builtin.Int32
81
+ %c20 = builtin "assert_configuration"() : $Builtin.Int32
82
+ %c21 = builtin "assert_configuration"() : $Builtin.Int32
83
+ %c22 = builtin "assert_configuration"() : $Builtin.Int32
84
+
85
+
86
+
87
+ %1 = struct_extract %0 : $goo, #goo.top
88
+ %2 = ref_element_addr %1 : $foo, #foo.a
89
+ %3 = load %2 : $*Int
90
+ %4 = function_ref @use_Int : $@convention(thin) (Int) -> ()
91
+ apply %4(%3) : $@convention(thin) (Int) -> ()
92
+
93
+ %5 = struct_extract %0 : $goo, #goo.bottom
94
+ %6 = ref_element_addr %5 : $foo, #foo.a
95
+ %7 = load %6 : $*Int
96
+ apply %4(%7) : $@convention(thin) (Int) -> ()
97
+
98
+ release_value %1 : $foo
99
+ %8 = tuple ()
100
+ return %8 : $()
101
+ }
102
+
47
103
// We do this check separately to ensure that this does not occur anywhere in
48
104
// the output for the file. (Maybe this is an interesting enough feature to add to FileCheck?).
49
105
@@ -174,6 +230,7 @@ bb0(%0 : $boo):
174
230
return %4 : $(Int, Int)
175
231
}
176
232
233
+
177
234
// CHECK-LABEL: sil [fragile] @dead_arg_no_callsites : $@convention(thin) (Builtin.NativeObject, Builtin.NativeObject) -> () {
178
235
// CHECK-NOT: function_ref @_TTSf4d_n__dead_arg_no_callsites
179
236
sil [fragile] @dead_arg_no_callsites : $@convention(thin) (Builtin.NativeObject, Builtin.NativeObject) -> () {
@@ -720,7 +777,13 @@ bb0(%0 : $boo):
720
777
return %5 : $()
721
778
}
722
779
723
-
780
+ sil [fragile] @argument_with_incomplete_epilogue_release_callsite : $@convention(thin) (@owned goo) -> () {
781
+ bb0(%0 : $goo):
782
+ %2 = function_ref @argument_with_incomplete_epilogue_release : $@convention(thin) (@owned goo) -> ()
783
+ %4 = apply %2(%0) : $@convention(thin) (@owned goo) -> ()
784
+ %5 = tuple()
785
+ return %5 : $()
786
+ }
724
787
725
788
726
789
//========================================
0 commit comments