@@ -7,9 +7,9 @@ import Swift
7
7
8
8
sil [_semantics "no_inline_plz"] @callee_func : $@convention(thin) () -> Int32 {
9
9
bb0:
10
- %0 = integer_literal $Builtin.Int32, 3 // user: %1
11
- %1 = struct $Int32 (%0 : $Builtin.Int32) // user: %2
12
- return %1 : $Int32 // id: %2
10
+ %0 = integer_literal $Builtin.Int32, 3
11
+ %1 = struct $Int32 (%0 : $Builtin.Int32)
12
+ return %1 : $Int32
13
13
}
14
14
15
15
//Not every @_semantics should be skipped during the early inlining pass, but
21
21
//CHECK: end sil function 'caller_func'
22
22
sil @caller_func : $@convention(thin) () -> Int32 {
23
23
bb0:
24
- %0 = function_ref @callee_func : $@convention(thin) () -> Int32 // user: %1
25
- %1 = apply %0() : $@convention(thin) () -> Int32 // user: %2
26
- return %1 : $Int32 // id: %2
24
+ %0 = function_ref @callee_func : $@convention(thin) () -> Int32
25
+ %1 = apply %0() : $@convention(thin) () -> Int32
26
+ return %1 : $Int32
27
27
}
28
28
29
29
sil [_semantics "array.make_mutable"] @callee_func_with_to_be_skipped_during_inlining_semantics : $@convention(method) (@inout Int32) -> Int32 {
30
30
bb0(%self : $*Int32):
31
- %0 = integer_literal $Builtin.Int32, 3 // user: %1
32
- %1 = struct $Int32 (%0 : $Builtin.Int32) // user: %2
33
- return %1 : $Int32 // id: %2
31
+ %0 = integer_literal $Builtin.Int32, 3
32
+ %1 = struct $Int32 (%0 : $Builtin.Int32)
33
+ return %1 : $Int32
34
34
}
35
35
36
36
//Not every @_semantics should be skipped during the early inlining pass, but
@@ -44,17 +44,57 @@ sil @caller_func2 : $@convention(thin) () -> Int32 {
44
44
bb0:
45
45
%self = alloc_stack $Int32
46
46
%0 = function_ref @callee_func_with_to_be_skipped_during_inlining_semantics : $@convention(method) (@inout Int32) -> Int32 // user: %1
47
- %1 = apply %0(%self) : $@convention(method) (@inout Int32) -> Int32 // user: %2
47
+ %1 = apply %0(%self) : $@convention(method) (@inout Int32) -> Int32
48
48
dealloc_stack %self : $*Int32
49
- return %1 : $Int32 // id: %2
49
+ return %1 : $Int32
50
+ }
51
+
52
+ sil [_semantics "pair_no_escaping_closure"] @callee_func_with_pair_no_escaping_closure_semantics : $@convention(method) (@inout Int32) -> Int32 {
53
+ bb0(%self : $*Int32):
54
+ %0 = integer_literal $Builtin.Int32, 3
55
+ %1 = struct $Int32 (%0 : $Builtin.Int32)
56
+ return %1 : $Int32
57
+ }
58
+
59
+ //CHECK-LABEL: caller_func3
60
+ //CHECK: function_ref
61
+ //CHECK: apply
62
+ //CHECK: end sil function 'caller_func3'
63
+ sil @caller_func3 : $@convention(thin) () -> Int32 {
64
+ bb0:
65
+ %self = alloc_stack $Int32
66
+ %0 = function_ref @callee_func_with_pair_no_escaping_closure_semantics : $@convention(method) (@inout Int32) -> Int32 // user: %1
67
+ %1 = apply %0(%self) : $@convention(method) (@inout Int32) -> Int32
68
+ dealloc_stack %self : $*Int32
69
+ return %1 : $Int32
70
+ }
71
+
72
+ sil [_semantics "self_no_escaping_closure"] @callee_func_with_self_no_escaping_closure_semantics : $@convention(method) (@inout Int32) -> Int32 {
73
+ bb0(%self : $*Int32):
74
+ %0 = integer_literal $Builtin.Int32, 3
75
+ %1 = struct $Int32 (%0 : $Builtin.Int32)
76
+ return %1 : $Int32
77
+ }
78
+
79
+ //CHECK-LABEL: caller_func4
80
+ //CHECK: function_ref
81
+ //CHECK: apply
82
+ //CHECK: end sil function 'caller_func4'
83
+ sil @caller_func4 : $@convention(thin) () -> Int32 {
84
+ bb0:
85
+ %self = alloc_stack $Int32
86
+ %0 = function_ref @callee_func_with_self_no_escaping_closure_semantics : $@convention(method) (@inout Int32) -> Int32 // user: %1
87
+ %1 = apply %0(%self) : $@convention(method) (@inout Int32) -> Int32
88
+ dealloc_stack %self : $*Int32
89
+ return %1 : $Int32
50
90
}
51
91
52
92
// A function annotated with the @effects(readonly) attribute.
53
93
sil [readonly] @callee_func2 : $@convention(thin) () -> Int32 {
54
94
bb0:
55
- %0 = integer_literal $Builtin.Int32, 3 // user: %1
56
- %1 = struct $Int32 (%0 : $Builtin.Int32) // user: %2
57
- return %1 : $Int32 // id: %2
95
+ %0 = integer_literal $Builtin.Int32, 3
96
+ %1 = struct $Int32 (%0 : $Builtin.Int32)
97
+ return %1 : $Int32
58
98
}
59
99
60
100
//CHECK-LABEL: caller_func1
63
103
//CHECK-NEXT: ret
64
104
sil @caller_func1 : $@convention(thin) () -> Int32 {
65
105
bb0:
66
- %0 = function_ref @callee_func2 : $@convention(thin) () -> Int32 // user: %1
67
- %1 = apply %0() : $@convention(thin) () -> Int32 // user: %2
68
- return %1 : $Int32 // id: %2
106
+ %0 = function_ref @callee_func2 : $@convention(thin) () -> Int32
107
+ %1 = apply %0() : $@convention(thin) () -> Int32
108
+ return %1 : $Int32
69
109
}
70
110
0 commit comments