@@ -525,28 +525,35 @@ bb4:
525
525
return %1 : $Builtin.RawPointer
526
526
}
527
527
528
- // CHECK-LABEL: sil [ossa] @looprotate_copy :
528
+ // CHECK-LABEL: sil [ossa] @looprotate_copy_move_borrow :
529
529
// CHECK: bb0(%0 : $Int32, %1 : @guaranteed $Bar):
530
530
// CHECK: copy_value
531
+ // CHECK: move_value
532
+ // CHECK: begin_borrow
531
533
// CHECK: cond_br {{.*}}, bb2, bb1
532
534
// CHECK: copy_value
533
- // CHECK-LABEL: } // end sil function 'looprotate_copy'
534
- sil [ossa] @looprotate_copy : $@convention(thin) (Int32, @guaranteed Bar) -> Int32 {
535
+ // CHECK: move_value
536
+ // CHECK: begin_borrow
537
+ // CHECK-LABEL: } // end sil function 'looprotate_copy_move_borrow'
538
+ sil [ossa] @looprotate_copy_move_borrow : $@convention(thin) (Int32, @guaranteed Bar) -> Int32 {
535
539
bb0(%0 : $Int32, %1 : @guaranteed $Bar):
536
540
%2 = struct_extract %0 : $Int32, #Int32._value
537
541
%3 = integer_literal $Builtin.Int32, 0
538
542
br bb1(%2 : $Builtin.Int32, %3 : $Builtin.Int32)
539
543
540
544
bb1(%5 : $Builtin.Int32, %6 : $Builtin.Int32):
541
- %7 = copy_value %1 : $Bar
545
+ %c = copy_value %1 : $Bar
546
+ %m = move_value %c : $Bar
547
+ %7 = begin_borrow %m : $Bar
542
548
%8 = class_method %7 : $Bar, #Bar.foo : (Bar) -> () -> (), $@convention(method) (@guaranteed Bar) -> ()
543
549
%9 = apply %8(%7) : $@convention(method) (@guaranteed Bar) -> ()
544
550
%10 = struct $Int32 (%6 : $Builtin.Int32)
545
551
%11 = builtin "cmp_eq_Word"(%6 : $Builtin.Int32, %2 : $Builtin.Int32) : $Builtin.Int1
546
552
cond_br %11, bb3, bb2
547
553
548
554
bb2:
549
- destroy_value %7 : $Bar
555
+ end_borrow %7 : $Bar
556
+ destroy_value %m : $Bar
550
557
%14 = integer_literal $Builtin.Int32, 1
551
558
%15 = integer_literal $Builtin.Int1, -1
552
559
%16 = builtin "sadd_with_overflow_Word"(%6 : $Builtin.Int32, %14 : $Builtin.Int32, %15 : $Builtin.Int1) : $(Builtin.Int32, Builtin.Int1)
560
567
br bb1(%23 : $Builtin.Int32, %17 : $Builtin.Int32)
561
568
562
569
bb3:
563
- destroy_value %7 : $Bar
570
+ end_borrow %7 : $Bar
571
+ destroy_value %m : $Bar
564
572
%26 = struct $Int32 (%5 : $Builtin.Int32)
565
573
return %26 : $Int32
566
574
}
0 commit comments