@@ -286,3 +286,50 @@ bb0(%0 : $*Array<MyKlass>, %1 : @owned $MyKlass):
286
286
return %1 : $MyKlass
287
287
}
288
288
289
+ // CHECK-LABEL: sil [ossa] @propagate_inside_loop : $@convention(thin) (@owned MyKlass) -> () {
290
+ // CHECK: bb1:
291
+ // CHECK-NOT: apply
292
+ // CHECK-LABEL: end sil function 'propagate_inside_loop'
293
+ sil [ossa] @propagate_inside_loop : $@convention(thin) (@owned MyKlass) -> () {
294
+ bb0(%arg0 : @owned $MyKlass):
295
+ %0 = function_ref @swift_bufferAllocate : $@convention(thin) () -> @owned _ContiguousArrayStorage<MyKlass>
296
+ %1 = integer_literal $Builtin.Word, 1
297
+ %2 = struct $MyInt (%1 : $Builtin.Word)
298
+ %3 = apply %0() : $@convention(thin) () -> @owned _ContiguousArrayStorage<MyKlass>
299
+ %4 = metatype $@thin MyArray<MyKlass>.Type
300
+ %5 = function_ref @adoptStorage : $@convention(thin) (@owned _ContiguousArrayStorage<MyKlass>, MyInt, @thin MyArray<MyKlass>.Type) -> @owned (MyArray<MyKlass>, UnsafeMutablePointer<MyKlass>)
301
+ %6 = apply %5(%3, %2, %4) : $@convention(thin) (@owned _ContiguousArrayStorage<MyKlass>, MyInt, @thin MyArray<MyKlass>.Type) -> @owned (MyArray<MyKlass>, UnsafeMutablePointer<MyKlass>)
302
+ (%7, %8a) = destructure_tuple %6 : $(MyArray<MyKlass>, UnsafeMutablePointer<MyKlass>)
303
+ %8 = mark_dependence %8a : $UnsafeMutablePointer<MyKlass> on %7 : $MyArray<MyKlass>
304
+ %9 = struct_extract %8 : $UnsafeMutablePointer<MyKlass>, #UnsafeMutablePointer._rawValue
305
+ %10 = pointer_to_address %9 : $Builtin.RawPointer to [strict] $*MyKlass
306
+ %11 = integer_literal $Builtin.Word, 0
307
+ %11a = struct $MyInt (%11 : $Builtin.Word)
308
+ store %arg0 to [init] %10 : $*MyKlass
309
+ %26 = alloc_stack $MyKlass
310
+ %27 = function_ref @hoistableIsNativeTypeChecked : $@convention(method) (@guaranteed MyArray<MyKlass>) -> MyBool
311
+ %28 = apply %27(%7) : $@convention(method) (@guaranteed MyArray<MyKlass>) -> MyBool
312
+ %29 = function_ref @checkSubscript : $@convention(method) (MyInt, MyBool, @guaranteed MyArray<MyKlass>) -> _MyDependenceToken
313
+ %30 = apply %29(%11a, %28, %7) : $@convention(method) (MyInt, MyBool, @guaranteed MyArray<MyKlass>) -> _MyDependenceToken
314
+ %31 = function_ref @getElement : $@convention(method) (MyInt, MyBool, _MyDependenceToken, @guaranteed MyArray<MyKlass>) -> @owned MyKlass
315
+ br bb1
316
+
317
+ bb1:
318
+ %32 = apply %31(%11a, %28, %30, %7) : $@convention(method) (MyInt, MyBool, _MyDependenceToken, @guaranteed MyArray<MyKlass>) -> @owned MyKlass
319
+ store %32 to [init] %26 : $*MyKlass
320
+ destroy_addr %26 : $*MyKlass
321
+ cond_br undef, bb2, bb3
322
+
323
+ bb2:
324
+ br bb1
325
+
326
+ bb3:
327
+ br bb4
328
+
329
+ bb4:
330
+ dealloc_stack %26 : $*MyKlass
331
+ destroy_value %7 : $MyArray<MyKlass>
332
+ %52 = tuple ()
333
+ return %52 : $()
334
+ }
335
+
0 commit comments