@@ -14,28 +14,36 @@ import Swift
14
14
@_alwaysEmitIntoClient @inlinable deinit
15
15
}
16
16
17
- sil @$sSp12deinitialize5countSvSi_tF : $@convention(method) <τ_0_0 where τ_0_0 : ~Copyable> (Int, UnsafeMutablePointer<τ_0_0>) -> UnsafeMutableRawPointer
17
+ struct Int {
18
+ var _value: Builtin.Int64
19
+ }
20
+ sil @deinit_count : $@convention(method) <τ_0_0 where τ_0_0 : ~Copyable> (moveonly_value_functions.Int, UnsafeMutablePointer<τ_0_0>) -> UnsafeMutableRawPointer
18
21
19
22
// CHECK-LABEL: define{{.*}} @"$s15Synchronization5_CellVAARi_zrlEfD"(
20
23
// CHECK-SAME: ptr %"_Cell<Value>",
21
24
// CHECK-SAME: ptr noalias swiftself [[SOURCE:%[0-9]+]]
22
25
// CHECK-SAME: )
23
26
// CHECK-SAME: {
24
27
// CHECK: entry:
25
- // CHECK: [[CELL_VWT_ADDR:%[^,]+]] = getelementptr inbounds ptr, ptr %"_Cell<Value>", i64 -1
28
+ // CHECK: [[CELL_VWT_ADDR:%[^,]+]] = getelementptr inbounds ptr, ptr %"_Cell<Value>", [[INT]] -1
26
29
// CHECK: %"_Cell<Value>.valueWitnesses" = load ptr, ptr [[CELL_VWT_ADDR]]
27
- // CHECK: [[CELL_SIZE_ADDR:%[^,]+]] = getelementptr inbounds %swift.vwtable, ptr %"_Cell<Value>.valueWitnesses", i32 0, i32 8
28
- // CHECK: %size = load i64, ptr [[CELL_SIZE_ADDR]]
29
- // CHECK: [[DEST:%[^,]+]] = alloca i8, i64 %size
30
+ // CHECK: [[CELL_SIZE_ADDR:%[^,]+]] = getelementptr inbounds %swift.vwtable
31
+ // : ptr %"_Cell<Value>.valueWitnesses",
32
+ // CHECK-SAME: i32 0
33
+ // CHECK-SAME: i32 8
34
+ // CHECK: %size = load [[INT]], ptr [[CELL_SIZE_ADDR]]
35
+ // CHECK: [[DEST:%[^,]+]] = alloca i8, [[INT]] %size
30
36
// CHECK: call void @llvm.lifetime.start.p0(i64 -1, ptr [[DEST]])
31
- // CHECK: [[VALUE_METADATA_ADDR:%[^,]+]] = getelementptr inbounds ptr, ptr %"_Cell<Value>", i64 2
37
+ // CHECK: [[VALUE_METADATA_ADDR:%[^,]+]] = getelementptr inbounds ptr, ptr %"_Cell<Value>", [[INT]] 2
32
38
// CHECK: %Value = load ptr, ptr [[VALUE_METADATA_ADDR]]
33
- // CHECK: [[VALUE_VWT_ADDR:%[^,]+]] = getelementptr inbounds ptr, ptr %Value, i64 -1
39
+ // CHECK: [[VALUE_VWT_ADDR:%[^,]+]] = getelementptr inbounds ptr, ptr %Value, [[INT]] -1
34
40
// CHECK: %Value.valueWitnesses = load ptr, ptr [[VALUE_VWT_ADDR]]
35
- // CHECK: [[VALUE_INIT_WITH_TAKE_ADDR:%[^,]+]] = getelementptr inbounds ptr, ptr %Value.valueWitnesses, i32 4
41
+ // CHECK: [[VALUE_INIT_WITH_TAKE_ADDR:%[^,]+]] = getelementptr inbounds ptr
42
+ // : ptr %Value.valueWitnesses
43
+ // CHECK-SAME: i32 4
36
44
// CHECK: %InitializeWithTake = load ptr, ptr [[VALUE_INIT_WITH_TAKE_ADDR]]
37
45
// CHECK: call ptr %InitializeWithTake(ptr noalias [[DEST]], ptr noalias [[SOURCE]], ptr %Value)
38
- // CHECK: call swiftcc ptr @"$sSp12deinitialize5countSvSi_tF" (i64 1, ptr [[DEST]], ptr %Value)
46
+ // CHECK: call swiftcc ptr @deinit_count (i64 1, ptr [[DEST]], ptr %Value)
39
47
// CHECK: call void @llvm.lifetime.end.p0(i64 -1, ptr [[DEST]])
40
48
// CHECK: }
41
49
sil @$s15Synchronization5_CellVAARi_zrlEfD : $@convention(method) <Value where Value : ~Copyable> (@in _Cell<Value>) -> () {
@@ -46,8 +54,8 @@ bb0(%0 : $*_Cell<Value>):
46
54
%8 = struct $UnsafeMutablePointer<Value> (%7 : $Builtin.RawPointer)
47
55
%9 = integer_literal $Builtin.Int64, 1
48
56
%10 = struct $Int (%9 : $Builtin.Int64)
49
- %11 = function_ref @$sSp12deinitialize5countSvSi_tF : $@convention(method) <τ_0_0 where τ_0_0 : ~Copyable> (Int, UnsafeMutablePointer<τ_0_0>) -> UnsafeMutableRawPointer
50
- %12 = apply %11<Value>(%10, %8) : $@convention(method) <τ_0_0 where τ_0_0 : ~Copyable> (Int, UnsafeMutablePointer<τ_0_0>) -> UnsafeMutableRawPointer
57
+ %11 = function_ref @deinit_count : $@convention(method) <τ_0_0 where τ_0_0 : ~Copyable> (moveonly_value_functions. Int, UnsafeMutablePointer<τ_0_0>) -> UnsafeMutableRawPointer
58
+ %12 = apply %11<Value>(%10, %8) : $@convention(method) <τ_0_0 where τ_0_0 : ~Copyable> (moveonly_value_functions. Int, UnsafeMutablePointer<τ_0_0>) -> UnsafeMutableRawPointer
51
59
%13 = tuple ()
52
60
dealloc_stack %1 : $*_Cell<Value>
53
61
return %13 : $()
0 commit comments