Skip to content

Commit 473905b

Browse files
committed
Handle mark_dependence in ArrayElementPropagation
1 parent 08cd370 commit 473905b

File tree

5 files changed

+72
-26
lines changed

5 files changed

+72
-26
lines changed

lib/SILOptimizer/Analysis/ArraySemantic.cpp

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -841,7 +841,8 @@ bool swift::ArraySemanticsCall::mapInitializationStores(
841841
return false;
842842

843843
// Match initialization stores into ElementBuffer. E.g.
844-
// %83 = struct_extract %element_buffer : $UnsafeMutablePointer<Int>
844+
// %82 = struct_extract %element_buffer : $UnsafeMutablePointer<Int>
845+
// %83 = mark_dependence %82 : $Builtin.RawPointer on ArrayVal
845846
// %84 = pointer_to_address %83 : $Builtin.RawPointer to strict $*Int
846847
// store %85 to %84 : $*Int
847848
// %87 = integer_literal $Builtin.Word, 1
@@ -850,12 +851,27 @@ bool swift::ArraySemanticsCall::mapInitializationStores(
850851

851852
// If this an ArrayUninitializedIntrinsic then the ElementBuffer is a
852853
// builtin.RawPointer. Otherwise, it is an UnsafeMutablePointer, which would
853-
// be struct-extracted to obtain a builtin.RawPointer.
854-
SILValue UnsafeMutablePointerExtract =
855-
(getKind() == ArrayCallKind::kArrayUninitialized)
856-
? dyn_cast_or_null<StructExtractInst>(
857-
getSingleNonDebugUser(ElementBuffer))
858-
: ElementBuffer;
854+
// be struct-extracted to obtain a builtin.RawPointer. In this case
855+
// mark_dependence can be an operand of the struct_extract or its user.
856+
857+
SILValue UnsafeMutablePointerExtract;
858+
if (getKind() == ArrayCallKind::kArrayUninitializedIntrinsic) {
859+
UnsafeMutablePointerExtract = dyn_cast_or_null<MarkDependenceInst>(
860+
getSingleNonDebugUser(ElementBuffer));
861+
} else {
862+
auto user = getSingleNonDebugUser(ElementBuffer);
863+
// Match mark_dependence (struct_extract or
864+
// struct_extract (mark_dependence
865+
if (auto *MDI = dyn_cast_or_null<MarkDependenceInst>(user)) {
866+
UnsafeMutablePointerExtract =
867+
dyn_cast_or_null<StructExtractInst>(getSingleNonDebugUser(MDI));
868+
} else {
869+
if (auto *SEI = dyn_cast_or_null<StructExtractInst>(user)) {
870+
UnsafeMutablePointerExtract =
871+
dyn_cast_or_null<MarkDependenceInst>(getSingleNonDebugUser(SEI));
872+
}
873+
}
874+
}
859875
if (!UnsafeMutablePointerExtract)
860876
return false;
861877

lib/SILOptimizer/Transforms/ArrayElementValuePropagation.cpp

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,9 @@ bool ArrayAllocation::replacementsAreValid() {
122122
/// Recursively look at all uses of this definition. Abort if the array value
123123
/// could escape or be changed. Collect all uses that are calls to array.count.
124124
bool ArrayAllocation::recursivelyCollectUses(ValueBase *Def) {
125+
LLVM_DEBUG(llvm::dbgs() << "Collecting uses of:");
126+
LLVM_DEBUG(Def->dump());
127+
125128
for (auto *Opd : Def->getUses()) {
126129
auto *User = Opd->getUser();
127130
// Ignore reference counting and debug instructions.
@@ -181,17 +184,28 @@ bool ArrayAllocation::analyze(ApplyInst *Alloc) {
181184
if (!Uninitialized)
182185
return false;
183186

187+
LLVM_DEBUG(llvm::dbgs() << "Found array allocation: ");
188+
LLVM_DEBUG(Alloc->dump());
189+
184190
ArrayValue = Uninitialized.getArrayValue();
185-
if (!ArrayValue)
191+
if (!ArrayValue) {
192+
LLVM_DEBUG(llvm::dbgs() << "Did not find array value\n");
186193
return false;
194+
}
187195

196+
LLVM_DEBUG(llvm::dbgs() << "ArrayValue: ");
197+
LLVM_DEBUG(ArrayValue->dump());
188198
// Figure out all stores to the array.
189-
if (!mapInitializationStores(Uninitialized))
199+
if (!mapInitializationStores(Uninitialized)) {
200+
LLVM_DEBUG(llvm::dbgs() << "Could not map initializing stores\n");
190201
return false;
202+
}
191203

192204
// Check if the array value was stored or has escaped.
193-
if (!recursivelyCollectUses(ArrayValue))
205+
if (!recursivelyCollectUses(ArrayValue)) {
206+
LLVM_DEBUG(llvm::dbgs() << "Array value stored or escaped\n");
194207
return false;
208+
}
195209

196210
return true;
197211
}
@@ -328,7 +342,9 @@ class ArrayElementPropagation : public SILFunctionTransform {
328342
auto &Fn = *getFunction();
329343
bool Changed = false;
330344

331-
for (auto &BB :Fn) {
345+
LLVM_DEBUG(llvm::dbgs() << "ArrayElementPropagation looking at function: "
346+
<< Fn.getName() << "\n");
347+
for (auto &BB : Fn) {
332348
for (auto &Inst : BB) {
333349
if (auto *Apply = dyn_cast<ApplyInst>(&Inst)) {
334350
ArrayAllocation ALit;

test/SILOptimizer/array_element_propagation.sil

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ sil @propagate_with_get_element_returning_direct_result : $@convention(thin) ()
7070
%5 = function_ref @adoptStorage : $@convention(thin) (@owned AnyObject, MyInt, @thin MyArray<MyInt>.Type) -> @owned (MyArray<MyInt>, UnsafeMutablePointer<MyInt>)
7171
%6 = apply %5(%3, %2, %4) : $@convention(thin) (@owned AnyObject, MyInt, @thin MyArray<MyInt>.Type) -> @owned (MyArray<MyInt>, UnsafeMutablePointer<MyInt>)
7272
%7 = tuple_extract %6 : $(MyArray<MyInt>, UnsafeMutablePointer<MyInt>), 0
73-
%8 = tuple_extract %6 : $(MyArray<MyInt>, UnsafeMutablePointer<MyInt>), 1
73+
%8a = tuple_extract %6 : $(MyArray<MyInt>, UnsafeMutablePointer<MyInt>), 1
74+
%8 = mark_dependence %8a : $UnsafeMutablePointer<MyInt> on %7 : $MyArray<MyInt>
7475
debug_value %7 : $MyArray<MyInt>
7576
debug_value %8 : $UnsafeMutablePointer<MyInt>
7677
%9 = struct_extract %8 : $UnsafeMutablePointer<MyInt>, #UnsafeMutablePointer._rawValue
@@ -144,7 +145,8 @@ sil @repeated_initialization : $@convention(thin) () -> () {
144145
%5 = function_ref @adoptStorage : $@convention(thin) (@owned AnyObject, MyInt, @thin MyArray<MyInt>.Type) -> @owned (MyArray<MyInt>, UnsafeMutablePointer<MyInt>)
145146
%6 = apply %5(%3, %2, %4) : $@convention(thin) (@owned AnyObject, MyInt, @thin MyArray<MyInt>.Type) -> @owned (MyArray<MyInt>, UnsafeMutablePointer<MyInt>)
146147
%7 = tuple_extract %6 : $(MyArray<MyInt>, UnsafeMutablePointer<MyInt>), 0
147-
%8 = tuple_extract %6 : $(MyArray<MyInt>, UnsafeMutablePointer<MyInt>), 1
148+
%8a = tuple_extract %6 : $(MyArray<MyInt>, UnsafeMutablePointer<MyInt>), 1
149+
%8 = mark_dependence %8a : $UnsafeMutablePointer<MyInt> on %7 : $MyArray<MyInt>
148150
%9 = struct_extract %8 : $UnsafeMutablePointer<MyInt>, #UnsafeMutablePointer._rawValue
149151
%10 = pointer_to_address %9 : $Builtin.RawPointer to [strict] $*MyInt
150152
%11 = integer_literal $Builtin.Int64, 0
@@ -193,7 +195,8 @@ sil @unknown_use : $@convention(thin) () -> () {
193195
%5 = function_ref @adoptStorage : $@convention(thin) (@owned AnyObject, MyInt, @thin MyArray<MyInt>.Type) -> @owned (MyArray<MyInt>, UnsafeMutablePointer<MyInt>)
194196
%6 = apply %5(%3, %2, %4) : $@convention(thin) (@owned AnyObject, MyInt, @thin MyArray<MyInt>.Type) -> @owned (MyArray<MyInt>, UnsafeMutablePointer<MyInt>)
195197
%7 = tuple_extract %6 : $(MyArray<MyInt>, UnsafeMutablePointer<MyInt>), 0
196-
%8 = tuple_extract %6 : $(MyArray<MyInt>, UnsafeMutablePointer<MyInt>), 1
198+
%8a = tuple_extract %6 : $(MyArray<MyInt>, UnsafeMutablePointer<MyInt>), 1
199+
%8 = mark_dependence %8a : $UnsafeMutablePointer<MyInt> on %7 : $MyArray<MyInt>
197200
%9 = struct_extract %8 : $UnsafeMutablePointer<MyInt>, #UnsafeMutablePointer._rawValue
198201
%10 = pointer_to_address %9 : $Builtin.RawPointer to [strict] $*MyInt
199202
%11 = integer_literal $Builtin.Int64, 0
@@ -240,7 +243,8 @@ sil @append_contentsOf_int : $@convention(thin) () -> () {
240243
%5 = function_ref @arrayAdoptStorage : $@convention(thin) (@owned AnyObject, MyInt, @thin Array<MyInt>.Type) -> @owned (Array<MyInt>, UnsafeMutablePointer<MyInt>)
241244
%6 = apply %5(%3, %2, %4) : $@convention(thin) (@owned AnyObject, MyInt, @thin Array<MyInt>.Type) -> @owned (Array<MyInt>, UnsafeMutablePointer<MyInt>)
242245
%7 = tuple_extract %6 : $(Array<MyInt>, UnsafeMutablePointer<MyInt>), 0
243-
%8 = tuple_extract %6 : $(Array<MyInt>, UnsafeMutablePointer<MyInt>), 1
246+
%8a = tuple_extract %6 : $(Array<MyInt>, UnsafeMutablePointer<MyInt>), 1
247+
%8 = mark_dependence %8a : $UnsafeMutablePointer<MyInt> on %7 : $Array<MyInt>
244248
%9 = struct_extract %8 : $UnsafeMutablePointer<MyInt>, #UnsafeMutablePointer._rawValue
245249
%10 = pointer_to_address %9 : $Builtin.RawPointer to [strict] $*MyInt
246250
%11 = integer_literal $Builtin.Int64, 27
@@ -289,7 +293,8 @@ bb0(%0 : $*Array<Hello>, %1 : $Hello):
289293
%9 = function_ref @adoptStorageHello : $@convention(method) (@owned _ContiguousArrayStorage<Hello>, MyInt, @thin Array<Hello>.Type) -> (@owned Array<Hello>, UnsafeMutablePointer<Hello>)
290294
%10 = apply %9(%7, %6, %8) : $@convention(method) (@owned _ContiguousArrayStorage<Hello>, MyInt, @thin Array<Hello>.Type) -> (@owned Array<Hello>, UnsafeMutablePointer<Hello>)
291295
%11 = tuple_extract %10 : $(Array<Hello>, UnsafeMutablePointer<Hello>), 0
292-
%12 = tuple_extract %10 : $(Array<Hello>, UnsafeMutablePointer<Hello>), 1
296+
%12a = tuple_extract %10 : $(Array<Hello>, UnsafeMutablePointer<Hello>), 1
297+
%12 = mark_dependence %12a : $UnsafeMutablePointer<Hello> on %7 : $_ContiguousArrayStorage<Hello>
293298
%13 = struct_extract %12 : $UnsafeMutablePointer<Hello>, #UnsafeMutablePointer._rawValue
294299
%22 = pointer_to_address %13 : $Builtin.RawPointer to [strict] $*Hello
295300
strong_retain %1 : $Hello

test/SILOptimizer/array_element_propagation_ossa.sil

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ sil [ossa] @propagate_with_get_element_returning_direct_result : $@convention(th
6868
%4 = metatype $@thin MyArray<MyInt>.Type
6969
%5 = function_ref @adoptStorage : $@convention(thin) (@owned AnyObject, MyInt, @thin MyArray<MyInt>.Type) -> @owned (MyArray<MyInt>, UnsafeMutablePointer<MyInt>)
7070
%6 = apply %5(%3, %2, %4) : $@convention(thin) (@owned AnyObject, MyInt, @thin MyArray<MyInt>.Type) -> @owned (MyArray<MyInt>, UnsafeMutablePointer<MyInt>)
71-
(%7, %8) = destructure_tuple %6 : $(MyArray<MyInt>, UnsafeMutablePointer<MyInt>)
71+
(%7, %8a) = destructure_tuple %6 : $(MyArray<MyInt>, UnsafeMutablePointer<MyInt>)
72+
%8 = mark_dependence %8a : $UnsafeMutablePointer<MyInt> on %7 : $MyArray<MyInt>
7273
debug_value %7 : $MyArray<MyInt>
7374
debug_value %8 : $UnsafeMutablePointer<MyInt>
7475
%9 = struct_extract %8 : $UnsafeMutablePointer<MyInt>, #UnsafeMutablePointer._rawValue
@@ -138,7 +139,8 @@ sil [ossa] @repeated_initialization : $@convention(thin) () -> () {
138139
%4 = metatype $@thin MyArray<MyInt>.Type
139140
%5 = function_ref @adoptStorage : $@convention(thin) (@owned AnyObject, MyInt, @thin MyArray<MyInt>.Type) -> @owned (MyArray<MyInt>, UnsafeMutablePointer<MyInt>)
140141
%6 = apply %5(%3, %2, %4) : $@convention(thin) (@owned AnyObject, MyInt, @thin MyArray<MyInt>.Type) -> @owned (MyArray<MyInt>, UnsafeMutablePointer<MyInt>)
141-
(%7, %8) = destructure_tuple %6 : $(MyArray<MyInt>, UnsafeMutablePointer<MyInt>)
142+
(%7, %8a) = destructure_tuple %6 : $(MyArray<MyInt>, UnsafeMutablePointer<MyInt>)
143+
%8 = mark_dependence %8a : $UnsafeMutablePointer<MyInt> on %7 : $MyArray<MyInt>
142144
%9 = struct_extract %8 : $UnsafeMutablePointer<MyInt>, #UnsafeMutablePointer._rawValue
143145
%10 = pointer_to_address %9 : $Builtin.RawPointer to [strict] $*MyInt
144146
%11 = integer_literal $Builtin.Int64, 0
@@ -185,7 +187,8 @@ sil [ossa] @unknown_use : $@convention(thin) () -> () {
185187
%4 = metatype $@thin MyArray<MyInt>.Type
186188
%5 = function_ref @adoptStorage : $@convention(thin) (@owned AnyObject, MyInt, @thin MyArray<MyInt>.Type) -> @owned (MyArray<MyInt>, UnsafeMutablePointer<MyInt>)
187189
%6 = apply %5(%3, %2, %4) : $@convention(thin) (@owned AnyObject, MyInt, @thin MyArray<MyInt>.Type) -> @owned (MyArray<MyInt>, UnsafeMutablePointer<MyInt>)
188-
(%7, %8) = destructure_tuple %6 : $(MyArray<MyInt>, UnsafeMutablePointer<MyInt>)
190+
(%7, %8a) = destructure_tuple %6 : $(MyArray<MyInt>, UnsafeMutablePointer<MyInt>)
191+
%8 = mark_dependence %8a : $UnsafeMutablePointer<MyInt> on %7 : $MyArray<MyInt>
189192
%9 = struct_extract %8 : $UnsafeMutablePointer<MyInt>, #UnsafeMutablePointer._rawValue
190193
%10 = pointer_to_address %9 : $Builtin.RawPointer to [strict] $*MyInt
191194
%11 = integer_literal $Builtin.Int64, 0
@@ -233,7 +236,8 @@ sil [ossa] @append_contentsOf_int : $@convention(thin) () -> () {
233236
%4 = metatype $@thin Array<MyInt>.Type
234237
%5 = function_ref @arrayAdoptStorage : $@convention(thin) (@owned AnyObject, MyInt, @thin Array<MyInt>.Type) -> @owned (Array<MyInt>, UnsafeMutablePointer<MyInt>)
235238
%6 = apply %5(%3, %2, %4) : $@convention(thin) (@owned AnyObject, MyInt, @thin Array<MyInt>.Type) -> @owned (Array<MyInt>, UnsafeMutablePointer<MyInt>)
236-
(%7, %8) = destructure_tuple %6 : $(Array<MyInt>, UnsafeMutablePointer<MyInt>)
239+
(%7, %8a) = destructure_tuple %6 : $(Array<MyInt>, UnsafeMutablePointer<MyInt>)
240+
%8 = mark_dependence %8a : $UnsafeMutablePointer<MyInt> on %7 : $Array<MyInt>
237241
%9 = struct_extract %8 : $UnsafeMutablePointer<MyInt>, #UnsafeMutablePointer._rawValue
238242
%10 = pointer_to_address %9 : $Builtin.RawPointer to [strict] $*MyInt
239243
%11 = integer_literal $Builtin.Int64, 27
@@ -257,7 +261,7 @@ sil [ossa] @append_contentsOf_int : $@convention(thin) () -> () {
257261
// CHECK-LABEL: sil [ossa] @negative_index
258262
// CHECK: store %{{[0-9]+}} to [trivial]
259263
// CHECK: [[GETF:%.*]] = function_ref @getElement : $@convention(method) (MyInt, MyBool, _MyDependenceToken, @guaranteed MyArray<MyInt>) -> MyInt
260-
// CHECK: apply [[GETF]](%15, %17, %19, %7) : $@convention(method) (MyInt, MyBool, _MyDependenceToken, @guaranteed MyArray<MyInt>) -> MyInt
264+
// CHECK: apply [[GETF]](%16, %18, %20, %7) : $@convention(method) (MyInt, MyBool, _MyDependenceToken, @guaranteed MyArray<MyInt>) -> MyInt
261265
// CHECK-LABEL: // end sil function 'negative_index'
262266
sil [ossa] @negative_index : $@convention(thin) () -> () {
263267
bb0:
@@ -268,7 +272,8 @@ bb0:
268272
%4 = metatype $@thin MyArray<MyInt>.Type
269273
%5 = function_ref @adoptStorage : $@convention(thin) (@owned AnyObject, MyInt, @thin MyArray<MyInt>.Type) -> @owned (MyArray<MyInt>, UnsafeMutablePointer<MyInt>)
270274
%6 = apply %5(%3, %2, %4) : $@convention(thin) (@owned AnyObject, MyInt, @thin MyArray<MyInt>.Type) -> @owned (MyArray<MyInt>, UnsafeMutablePointer<MyInt>)
271-
(%7, %8) = destructure_tuple %6 : $(MyArray<MyInt>, UnsafeMutablePointer<MyInt>)
275+
(%7, %8a) = destructure_tuple %6 : $(MyArray<MyInt>, UnsafeMutablePointer<MyInt>)
276+
%8 = mark_dependence %8a : $UnsafeMutablePointer<MyInt> on %7 : $MyArray<MyInt>
272277
%9 = struct_extract %8 : $UnsafeMutablePointer<MyInt>, #UnsafeMutablePointer._rawValue
273278
%10 = pointer_to_address %9 : $Builtin.RawPointer to [strict] $*MyInt
274279
%11 = integer_literal $Builtin.Int64, 0

test/SILOptimizer/array_element_propagation_ossa_nontrivial.sil

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ bb0(%arg0 : @owned $MyKlass, %arg1 : @owned $MyKlass, %arg2 : @owned $MyKlass):
6868
%4 = metatype $@thin MyArray<MyKlass>.Type
6969
%5 = function_ref @adoptStorage : $@convention(thin) (@owned _ContiguousArrayStorage<MyKlass>, MyInt, @thin MyArray<MyKlass>.Type) -> @owned (MyArray<MyKlass>, UnsafeMutablePointer<MyKlass>)
7070
%6 = apply %5(%3, %2, %4) : $@convention(thin) (@owned _ContiguousArrayStorage<MyKlass>, MyInt, @thin MyArray<MyKlass>.Type) -> @owned (MyArray<MyKlass>, UnsafeMutablePointer<MyKlass>)
71-
(%7, %8) = destructure_tuple %6 : $(MyArray<MyKlass>, UnsafeMutablePointer<MyKlass>)
71+
(%7, %8a) = destructure_tuple %6 : $(MyArray<MyKlass>, UnsafeMutablePointer<MyKlass>)
72+
%8 = mark_dependence %8a : $UnsafeMutablePointer<MyKlass> on %7 : $MyArray<MyKlass>
7273
debug_value %7 : $MyArray<MyKlass>
7374
debug_value %8 : $UnsafeMutablePointer<MyKlass>
7475
%9 = struct_extract %8 : $UnsafeMutablePointer<MyKlass>, #UnsafeMutablePointer._rawValue
@@ -143,7 +144,8 @@ bb0(%arg0 : @owned $MyKlass, %arg1 : @owned $MyKlass, %arg2 : @owned $MyKlass):
143144
%4 = metatype $@thin MyArray<MyKlass>.Type
144145
%5 = function_ref @adoptStorage : $@convention(thin) (@owned _ContiguousArrayStorage<MyKlass>, MyInt, @thin MyArray<MyKlass>.Type) -> @owned (MyArray<MyKlass>, UnsafeMutablePointer<MyKlass>)
145146
%6 = apply %5(%3, %2, %4) : $@convention(thin) (@owned _ContiguousArrayStorage<MyKlass>, MyInt, @thin MyArray<MyKlass>.Type) -> @owned (MyArray<MyKlass>, UnsafeMutablePointer<MyKlass>)
146-
(%7, %8) = destructure_tuple %6 : $(MyArray<MyKlass>, UnsafeMutablePointer<MyKlass>)
147+
(%7, %8a) = destructure_tuple %6 : $(MyArray<MyKlass>, UnsafeMutablePointer<MyKlass>)
148+
%8 = mark_dependence %8a : $UnsafeMutablePointer<MyKlass> on %7 : $MyArray<MyKlass>
147149
debug_value %7 : $MyArray<MyKlass>
148150
debug_value %8 : $UnsafeMutablePointer<MyKlass>
149151
%9 = struct_extract %8 : $UnsafeMutablePointer<MyKlass>, #UnsafeMutablePointer._rawValue
@@ -213,7 +215,8 @@ bb0(%arg0 : @owned $MyKlass):
213215
%4 = metatype $@thin MyArray<MyKlass>.Type
214216
%5 = function_ref @adoptStorage : $@convention(thin) (@owned _ContiguousArrayStorage<MyKlass>, MyInt, @thin MyArray<MyKlass>.Type) -> @owned (MyArray<MyKlass>, UnsafeMutablePointer<MyKlass>)
215217
%6 = apply %5(%3, %2, %4) : $@convention(thin) (@owned _ContiguousArrayStorage<MyKlass>, MyInt, @thin MyArray<MyKlass>.Type) -> @owned (MyArray<MyKlass>, UnsafeMutablePointer<MyKlass>)
216-
(%7, %8) = destructure_tuple %6 : $(MyArray<MyKlass>, UnsafeMutablePointer<MyKlass>)
218+
(%7, %8a) = destructure_tuple %6 : $(MyArray<MyKlass>, UnsafeMutablePointer<MyKlass>)
219+
%8 = mark_dependence %8a : $UnsafeMutablePointer<MyKlass> on %7 : $MyArray<MyKlass>
217220
debug_value %7 : $MyArray<MyKlass>
218221
debug_value %8 : $UnsafeMutablePointer<MyKlass>
219222
%9 = struct_extract %8 : $UnsafeMutablePointer<MyKlass>, #UnsafeMutablePointer._rawValue
@@ -272,7 +275,8 @@ bb0(%0 : $*Array<MyKlass>, %1 : @owned $MyKlass):
272275
%8 = metatype $@thin Array<MyKlass>.Type
273276
%9 = function_ref @adoptStorageMyKlass : $@convention(method) (@owned _ContiguousArrayStorage<MyKlass>, MyInt, @thin Array<MyKlass>.Type) -> (@owned Array<MyKlass>, UnsafeMutablePointer<MyKlass>)
274277
%10 = apply %9(%7, %6, %8) : $@convention(method) (@owned _ContiguousArrayStorage<MyKlass>, MyInt, @thin Array<MyKlass>.Type) -> (@owned Array<MyKlass>, UnsafeMutablePointer<MyKlass>)
275-
(%11, %12) = destructure_tuple %10 : $(Array<MyKlass>, UnsafeMutablePointer<MyKlass>)
278+
(%11, %12a) = destructure_tuple %10 : $(Array<MyKlass>, UnsafeMutablePointer<MyKlass>)
279+
%12 = mark_dependence %12a : $UnsafeMutablePointer<MyKlass> on %11 : $Array<MyKlass>
276280
%13 = struct_extract %12 : $UnsafeMutablePointer<MyKlass>, #UnsafeMutablePointer._rawValue
277281
%22 = pointer_to_address %13 : $Builtin.RawPointer to [strict] $*MyKlass
278282
%copy1 = copy_value %1 : $MyKlass

0 commit comments

Comments
 (0)