@@ -4303,14 +4303,13 @@ bb2(%5 : @owned $MyErrorType):
43034303 throw %5 : $MyErrorType
43044304}
43054305
4306- // CHECK-LABEL: sil [ossa] @mark_dependence_base :
4307- // CHECK: bb0(
4308- // CHECK-NOT: init_existential_ref
4309- // CHECK-NOT: enum
4310- // CHECK: mark_dependence %0 : $*Builtin.Int64 on {{%.*}} : $B
4311- // CHECK-NOT: init_existential_ref
4312- // CHECK-NOT: enum
4313- // CHECK: } // end sil function 'mark_dependence_base'
4306+ // CHECK-LABEL: sil [ossa] @mark_dependence_base
4307+ // XHECK: bb0(
4308+ // XHECK-NOT: init_existential_ref
4309+ // XHECK-NOT: enum
4310+ // XHECK-NEXT: mark_dependence
4311+ // XHECK-NEXT: load
4312+ // XHECK: return
43144313sil [ossa] @mark_dependence_base : $@convention(thin) (@inout Builtin.Int64, @owned B) -> Builtin.Int64 {
43154314bb0(%0 : $*Builtin.Int64, %1 : @owned $B):
43164315 %x = init_existential_ref %1 : $B : $B, $AnyObject
@@ -4322,10 +4321,10 @@ bb0(%0 : $*Builtin.Int64, %1 : @owned $B):
43224321}
43234322
43244323// CHECK-LABEL: sil [ossa] @mark_dependence_trivial_object_base :
4325- // CHECK : bb0(
4326- // CHECK -NEXT: copy_value
4327- // CHECK -NEXT: return
4328- // CHECK : } // end sil function 'mark_dependence_trivial_object_base'
4324+ // XHECK : bb0(
4325+ // XHECK -NEXT: copy_value
4326+ // XHECK -NEXT: return
4327+ // XHECK : } // end sil function 'mark_dependence_trivial_object_base'
43294328sil [ossa] @mark_dependence_trivial_object_base : $@convention(thin) (@guaranteed B) -> @owned B {
43304329bb0(%0 : @guaranteed $B):
43314330 %0a = copy_value %0 : $B
@@ -4357,14 +4356,13 @@ bb0(%addr : $*Builtin.Int64, %instance : @owned $B):
43574356
43584357protocol _NSArrayCore {}
43594358
4360- // CHECK-LABEL: sil [ossa] @mark_dependence_base2 :
4361- // CHECK: bb0(
4362- // CHECK-NOT: open_existential_ref
4363- // CHECK-NOT: enum
4364- // CHECK: mark_dependence %0 : $*Builtin.Int64 on {{%.*}} : $B
4365- // CHECK-NOT: open_existential_ref
4366- // CHECK-NOT: enum
4367- // CHECK: } // end sil function 'mark_dependence_base2'
4359+ // CHECK-LABEL: sil [ossa] @mark_dependence_base2
4360+ // XHECK: bb0(
4361+ // XHECK-NOT: open_existential_ref
4362+ // XHECK-NOT: enum
4363+ // XHECK-NEXT: mark_dependence
4364+ // XHECK-NEXT: load
4365+ // XHECK: return
43684366sil [ossa] @mark_dependence_base2 : $@convention(thin) (@inout Builtin.Int64, @owned B) -> Builtin.Int64 {
43694367bb0(%0 : $*Builtin.Int64, %1 : @owned $B):
43704368 %2 = init_existential_ref %1 : $B : $B, $AnyObject
@@ -5416,3 +5414,50 @@ bb0(%0 : $*MoveOnlyStruct):
54165414 return %16 : $()
54175415}
54185416
5417+ sil @originalClosure : $@convention(thin) (@owned Klass) -> ()
5418+ sil @useNoEscapeClosure : $@convention(thin) (@noescape @callee_guaranteed () -> ()) -> ()
5419+
5420+ // CHECK-LABEL: sil [ossa] @test_mark_dependence_ossa_silcombine1 :
5421+ // [[ENUM:%.*]] = enum
5422+ // [[MDI:%.*]] = mark_dependence {{.*}} on [[ENUM]]
5423+ // CHECK-LABEL: } // end sil function 'test_mark_dependence_ossa_silcombine1'
5424+ sil [ossa] @test_mark_dependence_ossa_silcombine1 : $@convention(thin) (@owned Klass) -> () {
5425+ bb0(%0 : @owned $Klass):
5426+ %1 = function_ref @originalClosure : $@convention(thin) (@owned Klass) -> ()
5427+ %2 = partial_apply [callee_guaranteed] %1(%0) : $@convention(thin) (@owned Klass) -> ()
5428+ %3 = convert_escape_to_noescape %2 : $@callee_guaranteed () -> () to $@noescape @callee_guaranteed () -> ()
5429+ %4 = enum $Optional<@callee_guaranteed () -> ()>, #Optional.some!enumelt, %2 : $@callee_guaranteed () -> ()
5430+ %5 = begin_borrow %4 : $Optional<@callee_guaranteed () -> ()>
5431+ %6 = mark_dependence %3 : $@noescape @callee_guaranteed () -> () on %5 : $Optional<@callee_guaranteed () -> ()>
5432+ %7 = function_ref @useNoEscapeClosure : $@convention(thin) (@noescape @callee_guaranteed () -> ()) -> ()
5433+ %8 = apply %7(%6) : $@convention(thin) (@noescape @callee_guaranteed () -> ()) -> ()
5434+ destroy_value %6 : $@noescape @callee_guaranteed () -> ()
5435+ end_borrow %5 : $Optional<@callee_guaranteed () -> ()>
5436+ destroy_value %4 : $Optional<@callee_guaranteed () -> ()>
5437+ %12 = tuple ()
5438+ return %12 : $()
5439+ }
5440+
5441+ // CHECK-LABEL: sil [ossa] @test_mark_dependence_ossa_silcombine2 :
5442+ // [[ENUM:%.*]] = enum
5443+ // [[MDI:%.*]] = mark_dependence {{.*}} on [[ENUM]]
5444+ // CHECK-LABEL: } // end sil function 'test_mark_dependence_ossa_silcombine2'
5445+ sil [ossa] @test_mark_dependence_ossa_silcombine2 : $@convention(thin) (@owned Klass) -> () {
5446+ bb0(%0 : @owned $Klass):
5447+ %1 = function_ref @originalClosure : $@convention(thin) (@owned Klass) -> ()
5448+ %2 = partial_apply [callee_guaranteed] %1(%0) : $@convention(thin) (@owned Klass) -> ()
5449+ %3 = convert_escape_to_noescape %2 : $@callee_guaranteed () -> () to $@noescape @callee_guaranteed () -> ()
5450+ %4 = enum $Optional<@callee_guaranteed () -> ()>, #Optional.some!enumelt, %2 : $@callee_guaranteed () -> ()
5451+ %5 = begin_borrow %4 : $Optional<@callee_guaranteed () -> ()>
5452+ %6 = mark_dependence %3 : $@noescape @callee_guaranteed () -> () on %5 : $Optional<@callee_guaranteed () -> ()>
5453+ %7 = function_ref @useNoEscapeClosure : $@convention(thin) (@noescape @callee_guaranteed () -> ()) -> ()
5454+ %8 = apply %7(%6) : $@convention(thin) (@noescape @callee_guaranteed () -> ()) -> ()
5455+ destroy_value %6 : $@noescape @callee_guaranteed () -> ()
5456+ br bb1(%4 : $Optional<@callee_guaranteed () -> ()>, %5 : $Optional<@callee_guaranteed () -> ()>)
5457+
5458+ bb1(%10 : @owned $Optional<@callee_guaranteed () -> ()>, %11 : @guaranteed $Optional<@callee_guaranteed () -> ()>):
5459+ end_borrow %11 : $Optional<@callee_guaranteed () -> ()>
5460+ destroy_value %10 : $Optional<@callee_guaranteed () -> ()>
5461+ %12 = tuple ()
5462+ return %12 : $()
5463+ }
0 commit comments