diff --git a/lib/SILGen/SILGenConcurrency.cpp b/lib/SILGen/SILGenConcurrency.cpp index 64455af5763..7fbff2494ed 100644 --- a/lib/SILGen/SILGenConcurrency.cpp +++ b/lib/SILGen/SILGenConcurrency.cpp @@ -27,7 +27,7 @@ using namespace Lowering; static void setExpectedExecutorForGeneric(SILGenFunction &SGF) { auto loc = RegularLocation::getAutoGeneratedLocation(SGF.F.getLocation()); - SGF.ExpectedExecutor.set(SGF.emitGenericExecutor(loc)); + SGF.ExpectedExecutor.set(SGF.emitNonIsolatedIsolation(loc).getValue()); } static void setExpectedExecutorForGlobalActor(SILGenFunction &SGF, @@ -284,8 +284,9 @@ void SILGenFunction::emitConstructorExpectedExecutorProlog() { loc.markAsPrologue(); loc = loc.asAutoGenerated(); - auto initialExecutor = emitGenericExecutor(loc); - B.createHopToExecutor(loc, initialExecutor, /*mandatory*/ false); + auto initialExecutor = emitNonIsolatedIsolation(loc); + B.createHopToExecutor(loc, initialExecutor.getValue(), + /*mandatory*/ false); return; } } diff --git a/test/Concurrency/attr_execution/conversions_silgen.swift b/test/Concurrency/attr_execution/conversions_silgen.swift index 048b7efefe3..48c07cb7eac 100644 --- a/test/Concurrency/attr_execution/conversions_silgen.swift +++ b/test/Concurrency/attr_execution/conversions_silgen.swift @@ -152,6 +152,8 @@ public func testCallerToCaller(_ x: nonisolated(nonsending) @escaping () async - // CHECK-LABEL: sil [ossa] @$s21attr_execution_silgen24testCallerLocalVariablesyyyyYaYCcYaF : $@convention(thin) @async (@guaranteed @async @callee_guaranteed (@sil_isolated @sil_implicit_leading_param @guaranteed Optional) -> ()) -> () { // CHECK: bb0([[PARAM:%.*]] : @guaranteed $@async @callee_guaranteed (@sil_isolated @sil_implicit_leading_param @guaranteed Optional) -> ()): +// CHECK: [[ACTOR:%.*]] = enum $Optional, #Optional.none!enumelt +// CHECK: hop_to_executor [[ACTOR]] // CHECK: [[PARAM_COPY:%.*]] = copy_value [[PARAM]] // CHECK: [[Y:%.*]] = move_value [lexical] [var_decl] [[PARAM_COPY]] // CHECK: [[Y_B:%.*]] = begin_borrow [[Y]] @@ -159,7 +161,6 @@ public func testCallerToCaller(_ x: nonisolated(nonsending) @escaping () async - // CHECK: [[Y2:%.*]] = move_value [lexical] [var_decl] [[Y_B_C]] // CHECK: [[Y2_B:%.*]] = begin_borrow [[Y2]] // CHECK: [[Y2_B_C:%.*]] = copy_value [[Y2_B]] -// CHECK: [[ACTOR:%.*]] = enum $Optional, #Optional.none!enumelt // CHECK: [[Y2_B_C_B:%.*]] = begin_borrow [[Y2_B_C]] // CHECK: apply [[Y2_B_C_B]]([[ACTOR]]) // CHECK: } // end sil function '$s21attr_execution_silgen24testCallerLocalVariablesyyyyYaYCcYaF' @@ -522,7 +523,7 @@ func testThatClosuresAssumeIsolation(fn: inout nonisolated(nonsending) (Int) asy testParam { 42 } // CHECK-LABEL: sil private [ossa] @$s21attr_execution_silgen31testThatClosuresAssumeIsolation2fnyySiYaYCcz_tFyyYaXEfU1_ : $@convention(thin) @async () -> () - // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none!enumelt + // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none!enumelt // CHECK: hop_to_executor [[GENERIC_EXECUTOR]] testParam { @concurrent in 42 } @@ -538,7 +539,7 @@ func testThatClosuresAssumeIsolation(fn: inout nonisolated(nonsending) (Int) asy fn = { _ in } // CHECK-LABEL: sil private [ossa] @$s21attr_execution_silgen31testThatClosuresAssumeIsolation2fnyySiYaYCcz_tFySiYacfU3_ : $@convention(thin) @async (Int) -> () - // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none!enumelt + // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none!enumelt // CHECK: hop_to_executor [[GENERIC_EXECUTOR]] // CHECK: } // end sil function '$s21attr_execution_silgen31testThatClosuresAssumeIsolation2fnyySiYaYCcz_tFySiYacfU3_' @@ -557,7 +558,7 @@ func testNoIsolationTransfer() { func testErasure(@_inheritActorContext _: @escaping @isolated(any) () async -> Void) {} // CHECK-LABEL: sil private [ossa] @$s21attr_execution_silgen23testNoIsolationTransferyyFyyYacfU_ : $@convention(thin) @async (@guaranteed Optional) -> () - // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none!enumelt + // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none!enumelt // CHECK: hop_to_executor [[GENERIC_EXECUTOR]] testErasure { @concurrent in } } @@ -566,7 +567,7 @@ func testClosuresDontAssumeGlobalActorWithMarkedAsConcurrent() { func test(_ fn: @MainActor () async -> Void) {} // CHECK-LABEL: sil private [ossa] @$s21attr_execution_silgen55testClosuresDontAssumeGlobalActorWithMarkedAsConcurrentyyFyyYaYbXEfU_ - // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none!enumelt + // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none!enumelt // CHECK-NEXT: hop_to_executor [[GENERIC_EXECUTOR]] // CHECK: } // end sil function '$s21attr_execution_silgen55testClosuresDontAssumeGlobalActorWithMarkedAsConcurrentyyFyyYaYbXEfU_' test { @Sendable @concurrent in diff --git a/test/Concurrency/attr_execution/witnesses.swift b/test/Concurrency/attr_execution/witnesses.swift index 6b649f09ed8..d23a851d71a 100644 --- a/test/Concurrency/attr_execution/witnesses.swift +++ b/test/Concurrency/attr_execution/witnesses.swift @@ -41,15 +41,13 @@ func testMainActorDispatch(t: T) async { } // CHECK-LABEL: sil hidden [ossa] @$s9witnesses19testGenericExecutor1tyx_tYaAA1PRzlF : $@convention(thin) @async (@in_guaranteed T) -> () -// CHECK: [[CONTEXT_ISOLATION:%.*]] = enum $Optional, #Optional.none!enumelt +// CHECK: [[CONTEXT_ISOLATION:%.*]] = enum $Optional, #Optional.none!enumelt // CHECK-NEXT: hop_to_executor [[CONTEXT_ISOLATION]] -// CHECK-NEXT: [[ISOLATION_ERASED_TO_ACTOR:%.*]] = enum $Optional, #Optional.none!enumelt // CHECK-NEXT: [[PROP_WITNESS:%.*]] = witness_method $T, #P.prop!getter : (Self) -> () async -> String : $@convention(witness_method: P) @async <τ_0_0 where τ_0_0 : P> (@sil_isolated @sil_implicit_leading_param @guaranteed Optional, @in_guaranteed τ_0_0) -> @owned String -// CHECK-NEXT: {{.*}} = apply [[PROP_WITNESS]]([[ISOLATION_ERASED_TO_ACTOR]], %0) : $@convention(witness_method: P) @async <τ_0_0 where τ_0_0 : P> (@sil_isolated @sil_implicit_leading_param @guaranteed Optional, @in_guaranteed τ_0_0) -> @owned String +// CHECK-NEXT: {{.*}} = apply [[PROP_WITNESS]]([[CONTEXT_ISOLATION]], %0) : $@convention(witness_method: P) @async <τ_0_0 where τ_0_0 : P> (@sil_isolated @sil_implicit_leading_param @guaranteed Optional, @in_guaranteed τ_0_0) -> @owned String // CHECK-NEXT: hop_to_executor [[CONTEXT_ISOLATION]] -// CHECK: [[ISOLATION_ERASED_TO_ACTOR:%.*]] = enum $Optional, #Optional.none!enumelt -// CHECK-NEXT: [[FN_WITNESS:%.*]] = witness_method $T, #P.fn : (Self) -> () async -> () : $@convention(witness_method: P) @async <τ_0_0 where τ_0_0 : P> (@sil_isolated @sil_implicit_leading_param @guaranteed Optional, @in_guaranteed τ_0_0) -> () -// CHECK-NEXT: {{.*}} = apply [[FN_WITNESS]]([[ISOLATION_ERASED_TO_ACTOR]], %0) : $@convention(witness_method: P) @async <τ_0_0 where τ_0_0 : P> (@sil_isolated @sil_implicit_leading_param @guaranteed Optional, @in_guaranteed τ_0_0) -> () +// CHECK: [[FN_WITNESS:%.*]] = witness_method $T, #P.fn : (Self) -> () async -> () : $@convention(witness_method: P) @async <τ_0_0 where τ_0_0 : P> (@sil_isolated @sil_implicit_leading_param @guaranteed Optional, @in_guaranteed τ_0_0) -> () +// CHECK-NEXT: {{.*}} = apply [[FN_WITNESS]]([[CONTEXT_ISOLATION]], %0) : $@convention(witness_method: P) @async <τ_0_0 where τ_0_0 : P> (@sil_isolated @sil_implicit_leading_param @guaranteed Optional, @in_guaranteed τ_0_0) -> () // CHECK: } // end sil function '$s9witnesses19testGenericExecutor1tyx_tYaAA1PRzlF' func testGenericExecutor(t: T) async { _ = await t.prop diff --git a/test/Concurrency/cross_module_let_sil.swift b/test/Concurrency/cross_module_let_sil.swift index 216d1939a8d..22cf8b4a6af 100644 --- a/test/Concurrency/cross_module_let_sil.swift +++ b/test/Concurrency/cross_module_let_sil.swift @@ -7,12 +7,12 @@ import OtherActors // CHECK-LABEL: sil hidden [ossa] @$s4test6check1ySi11OtherActors0C11ModuleActorCYaF : $@convention(thin) @async (@guaranteed OtherModuleActor) -> Int { // CHECK: bb0([[SELF:%[0-9]+]] : @guaranteed $OtherModuleActor): -// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none -// CHECK-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional +// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none +// CHECK-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional // CHECK: [[REF:%[0-9]+]] = ref_element_addr [[SELF]] : $OtherModuleActor, #OtherModuleActor.a // CHECK: hop_to_executor [[SELF]] : $OtherModuleActor // CHECK-NEXT: load [trivial] [[REF]] -// CHECK-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional +// CHECK-NEXT: hop_to_executor [[GENERIC_EXEC]] // CHECK: } // end sil function '$s4test6check1ySi11OtherActors0C11ModuleActorCYaF' func check1(_ actor: OtherModuleActor) async -> Int { return await actor.a @@ -24,23 +24,23 @@ func check2(_ actor: isolated OtherModuleActor) -> Int { // CHECK-LABEL: sil hidden [ossa] @$s4test6check3ySi11OtherActors0C11ModuleActorCYaF : $@convention(thin) @async (@guaranteed OtherModuleActor) -> Int { // CHECK: bb0([[SELF:%[0-9]+]] : @guaranteed $OtherModuleActor): -// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none -// CHECK-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional +// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none +// CHECK-NEXT: hop_to_executor [[GENERIC_EXEC]] func check3(_ actor: OtherModuleActor) async -> Int { return actor.b } // CHECK-LABEL: sil hidden [ossa] @$s4test6check4y11OtherActors17SomeSendableClassCSgAC0C11ModuleActorCSgYaF : $@convention(thin) @async (@guaranteed Optional) -> @owned Optional { // CHECK: bb0({{%[0-9]+}} : @guaranteed $Optional): -// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none -// CHECK-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional +// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none +// CHECK-NEXT: hop_to_executor [[GENERIC_EXEC]] // CHECK: switch_enum {{%[0-9]+}} : $Optional, case #Optional.some!enumelt: [[SOME:bb[0-9]+]], case #Optional.none!enumelt: {{bb[0-9]+}} // CHECK: [[SOME]]({{%[0-9]+}} : @owned $OtherModuleActor): // CHECK: [[REF:%[0-9]+]] = ref_element_addr {{%[0-9]+}} : $OtherModuleActor, #OtherModuleActor.d // CHECK: hop_to_executor {{%[0-9]+}} : $OtherModuleActor // CHECK-NEXT: load [copy] [[REF]] -// CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional +// CHECK: hop_to_executor [[GENERIC_EXEC]] // CHECK: } // end sil function '$s4test6check4y11OtherActors17SomeSendableClassCSgAC0C11ModuleActorCSgYaF' func check4(_ actor: OtherModuleActor?) async -> SomeSendableClass? { return await actor?.d diff --git a/test/Concurrency/isolated_default_argument_eval.swift b/test/Concurrency/isolated_default_argument_eval.swift index fa7debb2215..2d2e1d0c7b8 100644 --- a/test/Concurrency/isolated_default_argument_eval.swift +++ b/test/Concurrency/isolated_default_argument_eval.swift @@ -27,11 +27,11 @@ func mainActorMultiDefaultArg(x: Int = requiresMainActor(), // CHECK-LABEL: sil hidden [ossa] @$s30isolated_default_argument_eval22nonisolatedAsyncCalleryyYaF func nonisolatedAsyncCaller() async { - // CHECK: hop_to_executor {{.*}} : $Optional + // CHECK: hop_to_executor {{.*}} // CHECK: hop_to_executor {{.*}} : $MainActor // CHECK: [[GET_VALUE:%[0-9]+]] = function_ref @$s30isolated_default_argument_eval19mainActorDefaultArg5valueS2i_tFfA_ // CHECK-NEXT: apply [[GET_VALUE]]() - // CHECK: hop_to_executor {{.*}} : $Optional + // CHECK: hop_to_executor {{.*}} await mainActorDefaultArg() // CHECK: hop_to_executor {{.*}} : $MainActor @@ -46,7 +46,7 @@ func nonisolatedAsyncCaller() async { // CHECK-NOT: hop_to_executor // CHECK: [[GET_Z:%[0-9]+]] = function_ref @$s30isolated_default_argument_eval24mainActorMultiDefaultArg1x1y5tuple1zySi_S2i_SitSitFfA2_ // CHECK-NEXT: apply [[GET_Z]]() - // CHECK: hop_to_executor {{.*}} : $Optional + // CHECK: hop_to_executor {{.*}} await mainActorMultiDefaultArg() } @@ -57,7 +57,7 @@ var argValue: Int { 0 } // CHECK-LABEL: sil hidden [ossa] @$s30isolated_default_argument_eval20passInoutWithDefaultyyYaF func passInoutWithDefault() async { - // CHECK: hop_to_executor {{.*}} : $Optional + // CHECK: hop_to_executor {{.*}} var x = 0 @@ -69,7 +69,7 @@ func passInoutWithDefault() async { // CHECK-NEXT: [[Z:%[0-9]+]] = apply [[GET_Z]]() // CHECK: [[FN:%[0-9]+]] = function_ref @$s30isolated_default_argument_eval0A15DefaultInoutMix1x1y1zySiz_S2itF : $@convention(thin) (@inout Int, Int, Int) -> () // CHECK: apply [[FN]]([[INOUT_X]], [[ARG_VALUE]], [[Z]]) - // CHECK: hop_to_executor {{.*}} : $Optional + // CHECK: hop_to_executor {{.*}} await isolatedDefaultInoutMix(x: &x, y: argValue) } diff --git a/test/IRGen/typed_throws_abi.swift b/test/IRGen/typed_throws_abi.swift index 78cad66d967..1637e2841d7 100644 --- a/test/IRGen/typed_throws_abi.swift +++ b/test/IRGen/typed_throws_abi.swift @@ -3107,7 +3107,7 @@ func callNonMatching_f1(_ b: Bool) -> (Int, Float, Bool, Float) { // CHECK: [[SUCCESS]]: // CHECK: call i1 (ptr, i1, ...) @llvm.coro.end.async(ptr {{%.*}}, i1 false, ptr @"$s16typed_throws_abi20nonMatching_f0_asyncySf_SftSbYaAA7OneWordVYKF{{.*}}", ptr {{%.*}}, ptr {{%.*}}, float 1.000000e+00, float 2.000000e+00, i64 undef, ptr null) // CHECK: unreachable -// CHECK: 18: +// CHECK: [[ERROR]]: // CHECK: [[ERROR_X:%.*]] = call swiftcc i64 @"$s16typed_throws_abi7OneWordVACycfC"() // CHECK: [[ERROR_RET:%.*]] = insertvalue { float, float, i64 } undef, i64 [[ERROR_X]], 2 // CHECK: [[ERROR_RET0:%.*]] = extractvalue { float, float, i64 } [[ERROR_RET]], 0 diff --git a/test/SILGen/async_builtins.swift b/test/SILGen/async_builtins.swift index b7358581eea..702a71e32f9 100644 --- a/test/SILGen/async_builtins.swift +++ b/test/SILGen/async_builtins.swift @@ -2,6 +2,7 @@ // REQUIRES: concurrency import Swift +import _Concurrency public struct X { // CHECK-LABEL: sil hidden [ossa] @$s4test1XV14getCurrentTaskBoyYaF diff --git a/test/SILGen/async_initializer.swift b/test/SILGen/async_initializer.swift index 56b96e9ee70..85b71c6d41a 100644 --- a/test/SILGen/async_initializer.swift +++ b/test/SILGen/async_initializer.swift @@ -64,7 +64,7 @@ actor MyActor { // CHECK-DAG: sil hidden [ossa] @$s12initializers7MyActorCACyYacfc : $@convention(method) @async (@sil_isolated @owned MyActor) -> @owned MyActor // CHECK: bb0(%0 : @owned $MyActor): // In the prologue, hop to the generic executor. - // CHECK-NEXT: [[NIL_EXECUTOR:%.*]] = enum $Optional, #Optional.none + // CHECK-NEXT: [[NIL_EXECUTOR:%.*]] = enum $Optional, #Optional.none // CHECK-NEXT: hop_to_executor [[NIL_EXECUTOR]] : // Later, when we return from an async call, hop to the // correct flow-sensitive value. @@ -169,12 +169,12 @@ enum Birb { } // NI-LABEL: sil hidden [ossa] @$s12initializers7makeCatyyYaF : $@convention(thin) @async () -> () { -// NI: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none -// NI-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional +// NI: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none +// NI-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional // NI: hop_to_executor [[BORROWED_EXECUTOR:%[0-9]+]] // NI: end_borrow [[BORROWED_EXECUTOR]] // NI-NEXT: {{%[0-9]+}} = apply {{%[0-9]+}}({{%[0-9]+}}, {{%[0-9]+}}) : $@convention(method) (@owned String, @thick Cat.Type) -> @owned Cat -// NI: hop_to_executor [[GENERIC_EXEC]] : $Optional +// NI: hop_to_executor [[GENERIC_EXEC]] : $Optional // NI: } // end sil function '$s12initializers7makeCatyyYaF' // NI-NS-LABEL: sil hidden [ossa] @$s12initializers7makeCatyyYaF : $@convention(thin) @async (@sil_isolated @sil_implicit_leading_param @guaranteed Optional) -> () { @@ -192,12 +192,12 @@ func makeCat() async { } // NI-LABEL: sil hidden [ossa] @$s12initializers7makeDogyyYaF : $@convention(thin) @async () -> () { -// NI: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none -// NI-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional +// NI: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none +// NI-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional // NI: hop_to_executor [[BORROWED_EXEC:%.*]] : // NI-NEXT: end_borrow [[BORROWED_EXEC]] // NI-NEXT: {{%[0-9]+}} = apply {{%[0-9]+}}({{%[0-9]+}}, {{%[0-9]+}}) : $@convention(method) (@owned String, @thin Dog.Type) -> Dog -// NI: hop_to_executor [[GENERIC_EXEC]] : $Optional +// NI: hop_to_executor [[GENERIC_EXEC]] : $Optional // NI: } // end sil function '$s12initializers7makeDogyyYaF' // NI-NS-LABEL: sil hidden [ossa] @$s12initializers7makeDogyyYaF : $@convention(thin) @async (@sil_isolated @sil_implicit_leading_param @guaranteed Optional) -> () { @@ -213,12 +213,12 @@ func makeDog() async { } // NI-LABEL: sil hidden [ossa] @$s12initializers8makeBirbyyYaF : $@convention(thin) @async () -> () { -// NI: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none -// NI-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional +// NI: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none +// NI-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional // NI: hop_to_executor [[BORROWED_EXEC:%.*]] : $MainActor // NI-NEXT: end_borrow [[BORROWED_EXEC]] // NI-NEXT: {{%[0-9]+}} = apply {{%[0-9]+}}({{%[0-9]+}}, {{%[0-9]+}}) : $@convention(method) (@owned String, @thin Birb.Type) -> Birb -// NI: hop_to_executor [[GENERIC_EXEC]] : $Optional +// NI: hop_to_executor [[GENERIC_EXEC]] : $Optional // NI: } // end sil function '$s12initializers8makeBirbyyYaF' // NI-NS-LABEL: sil hidden [ossa] @$s12initializers8makeBirbyyYaF : $@convention(thin) @async (@sil_isolated @sil_implicit_leading_param @guaranteed Optional) -> () { @@ -238,7 +238,7 @@ actor SomeActor { // CHECK-LABEL: sil hidden [ossa] @$s12initializers9SomeActorCACyYacfc : $@convention(method) @async (@sil_isolated @owned SomeActor) -> @owned SomeActor { // CHECK: bb0(%0 : - // CHECK-NEXT: [[NIL_EXECUTOR:%.*]] = enum $Optional, #Optional.none + // CHECK-NEXT: [[NIL_EXECUTOR:%.*]] = enum $Optional, #Optional.none // CHECK-NEXT: hop_to_executor [[NIL_EXECUTOR]] init() async {} @@ -260,10 +260,10 @@ func makeActor() async -> SomeActor { } // NI-LABEL: sil hidden [ossa] @$s12initializers20makeActorFromGenericAA04SomeC0CyYaF : $@convention(thin) @async () -> @owned SomeActor { -// NI: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none -// NI-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional +// NI: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none +// NI-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional // NI: apply -// NI-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional +// NI-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional // NI: } // end sil function '$s12initializers20makeActorFromGenericAA04SomeC0CyYaF' // NI-NS-LABEL: sil hidden [ossa] @$s12initializers20makeActorFromGenericAA04SomeC0CyYaF : $@convention(thin) @async (@sil_isolated @sil_implicit_leading_param @guaranteed Optional) -> @owned SomeActor { @@ -277,10 +277,10 @@ func makeActorFromGeneric() async -> SomeActor { } // NI-LABEL: sil hidden [ossa] @$s12initializers26callActorMethodFromGeneric1ayAA04SomeC0C_tYaF : -// NI: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none -// NI-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional +// NI: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none +// NI-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional // NI: apply -// NI-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional +// NI-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional // NI: } // end sil function '$s12initializers26callActorMethodFromGeneric1ayAA04SomeC0C_tYaF' // NI-NS-LABEL: sil hidden [ossa] @$s12initializers26callActorMethodFromGeneric1ayAA04SomeC0C_tYaF : $@convention(thin) @async (@sil_isolated @sil_implicit_leading_param @guaranteed Optional, @guaranteed SomeActor) -> () { @@ -295,8 +295,8 @@ func callActorMethodFromGeneric(a: SomeActor) async { } // NI-LABEL: sil hidden {{.*}} @$s12initializers15makeActorInTaskyyYaF : $@convention(thin) @async () -> () { -// NI: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none -// NI-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional +// NI: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none +// NI-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional // NI: apply // NI: } // end sil function '$s12initializers15makeActorInTaskyyYaF' @@ -307,17 +307,17 @@ func callActorMethodFromGeneric(a: SomeActor) async { // NI-NS: } // end sil function '$s12initializers15makeActorInTaskyyYaF' // NI-LABEL: sil private [ossa] @$s12initializers15makeActorInTaskyyYaFAA04SomeC0CyYacfU_ : $@convention(thin) @async @substituted <τ_0_0> (@guaranteed Optional) -> @out τ_0_0 for { -// NI: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none -// NI-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional +// NI: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none +// NI-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional // NI: apply -// NI-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional +// NI-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional // NI: } // end sil function '$s12initializers15makeActorInTaskyyYaFAA04SomeC0CyYacfU_' // NI-NS-LABEL: sil private [ossa] @$s12initializers15makeActorInTaskyyYaFAA04SomeC0CyYacfU_ : $@convention(thin) @async @substituted <τ_0_0> (@guaranteed Optional) -> @out τ_0_0 for { -// NI-NS: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none -// NI-NS-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional +// NI-NS: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none +// NI-NS-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional // NI-NS: apply -// NI-NS-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional +// NI-NS-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional // NI-NS: } // end sil function '$s12initializers15makeActorInTaskyyYaFAA04SomeC0CyYacfU_' @available(SwiftStdlib 5.1, *) func makeActorInTask() async { @@ -325,8 +325,8 @@ func makeActorInTask() async { } // NI-LABEL: sil hidden {{.*}} @$s12initializers21callActorMethodInTask1ayAA04SomeC0C_tYaF : $@convention(thin) @async (@guaranteed SomeActor) -> () { -// NI: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none -// NI-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional +// NI: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none +// NI-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional // NI: apply // NI: } // end sil function '$s12initializers21callActorMethodInTask1ayAA04SomeC0C_tYaF' @@ -336,10 +336,10 @@ func makeActorInTask() async { // NI-NS: } // end sil function '$s12initializers21callActorMethodInTask1ayAA04SomeC0C_tYaF' // CHECK-LABEL: sil private [ossa] @$s12initializers21callActorMethodInTask1ayAA04SomeC0C_tYaFyyYacfU_ : $@convention(thin) @async @substituted <τ_0_0> (@guaranteed Optional, @guaranteed SomeActor) -> @out τ_0_0 for <()> { -// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none -// CHECK-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional +// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none +// CHECK-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional // CHECK: apply -// CHECK-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional +// CHECK-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional @available(SwiftStdlib 5.1, *) func callActorMethodInTask(a: SomeActor) async { Task.detached { await a.someMethod() } diff --git a/test/SILGen/execution_attr.swift b/test/SILGen/execution_attr.swift index 63dc3f0aac6..dc56e051eb6 100644 --- a/test/SILGen/execution_attr.swift +++ b/test/SILGen/execution_attr.swift @@ -38,9 +38,10 @@ struct S { // DISABLED: sil hidden [ossa] @$s14execution_attr0A11CallerFieldyyAA1SVYaF : $@convention(thin) @async (@guaranteed S) -> () { // DISABLED: bb0([[ARG:%.*]] : @guaranteed $S): +// DISABLED: [[ACTOR_NONE:%.*]] = enum $Optional, #Optional.none!enumelt +// DISABLED: hop_to_executor [[ACTOR_NONE]] // DISABLED: [[FIELD:%.*]] = struct_extract [[ARG]] // DISABLED: [[FIELD_COPY:%.*]] = copy_value [[FIELD]] -// DISABLED: [[ACTOR_NONE:%.*]] = enum $Optional, #Optional.none!enumelt // DISABLED: [[BORROWED_FIELD:%.*]] = begin_borrow [[FIELD_COPY]] // DISABLED: apply [[BORROWED_FIELD]]([[ACTOR_NONE]]) // DISABLED: } // end sil function '$s14execution_attr0A11CallerFieldyyAA1SVYaF' @@ -65,7 +66,7 @@ extension S { // CHECK-LABEL: sil hidden [ossa] @$s14execution_attr24testWithDynamicIsolation2fnyyyYAXE_tYaF : $@convention(thin) @async (@guaranteed @isolated(any) @noescape @callee_guaranteed () -> ()) -> () { // CHECK: bb0([[PARAM_FN:%.*]] : @guaranteed $@isolated(any) @noescape @callee_guaranteed () -> ()): -// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none!enumelt +// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none!enumelt // CHECK-NEXT: hop_to_executor [[GENERIC_EXEC]] // CHECK-NEXT: [[FN:%.*]] = copy_value [[PARAM_FN]] // CHECK-NEXT: [[BORROWED_FN:%.*]] = begin_borrow [[FN]] diff --git a/test/SILGen/hop_to_executor.swift b/test/SILGen/hop_to_executor.swift index a1daf20bed2..27399f366e6 100644 --- a/test/SILGen/hop_to_executor.swift +++ b/test/SILGen/hop_to_executor.swift @@ -3,7 +3,7 @@ // CHECK-LABEL: sil hidden [ossa] @$s4test16unspecifiedAsyncyyYaF : $@convention(thin) @async () -> () // CHECK: bb0: -// CHECK-NEXT: [[GENERIC:%[0-9]+]] = enum $Optional, #Optional.none!enumelt +// CHECK-NEXT: [[GENERIC:%[0-9]+]] = enum $Optional, #Optional.none!enumelt // CHECK-NEXT: hop_to_executor [[GENERIC]] // CHECK: } // end sil function '$s4test16unspecifiedAsyncyyYaF' func unspecifiedAsync() async {} @@ -13,7 +13,7 @@ actor MyActor { private var p: Int // CHECK-LABEL: sil hidden [ossa] @$s4test7MyActorC6calleeyySiYaF : $@convention(method) @async (Int, @guaranteed MyActor) -> () { - // CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none + // CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none // CHECK: hop_to_executor [[GENERIC_EXEC]] : // CHECK: } // end sil function '$s4test7MyActorC6calleeyySiYaF' nonisolated func callee(_ x: Int) async { @@ -21,7 +21,7 @@ actor MyActor { } // CHECK-LABEL: sil hidden [ossa] @$s4test7MyActorC14throwingCalleeyySiYaKF : $@convention(method) @async (Int, @guaranteed MyActor) -> @error any Error { - // CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none + // CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none // CHECK: hop_to_executor [[GENERIC_EXEC]] : // CHECK: } // end sil function '$s4test7MyActorC14throwingCalleeyySiYaKF' nonisolated func throwingCallee(_ x: Int) async throws { @@ -283,7 +283,7 @@ struct BlueActor { } // CHECK-LABEL: sil hidden [ossa] @$s4test20unspecifiedAsyncFuncyyYaF : $@convention(thin) @async () -> () { -// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none +// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none // CHECK-NEXT: hop_to_executor [[GENERIC_EXEC]] : // CHECK: [[BORROW:%[0-9]+]] = begin_borrow {{%[0-9]+}} : $RedActorImpl // CHECK-NEXT: hop_to_executor [[BORROW]] : $RedActorImpl @@ -298,7 +298,7 @@ func unspecifiedAsyncFunc() async { // CHECK-LABEL: sil hidden [ossa] @$s4test27anotherUnspecifiedAsyncFuncyyAA12RedActorImplCYaF : $@convention(thin) @async (@guaranteed RedActorImpl) -> () { // CHECK: bb0([[RED:%[0-9]+]] : @guaranteed $RedActorImpl): -// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none +// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none // CHECK-NEXT: hop_to_executor [[GENERIC_EXEC]] : // CHECK: [[INTARG:%[0-9]+]] = apply {{%[0-9]+}}({{%[0-9]+}}, {{%[0-9]+}}) : $@convention(method) (Builtin.IntLiteral, @thin Int.Type) -> Int // CHECK: [[METH:%[0-9]+]] = class_method [[RED]] : $RedActorImpl, #RedActorImpl.hello : (isolated RedActorImpl) -> (Int) -> (), $@convention(method) (Int, @sil_isolated @guaranteed RedActorImpl) -> () @@ -311,14 +311,14 @@ func anotherUnspecifiedAsyncFunc(_ red : RedActorImpl) async { } // CHECK-LABEL: sil hidden [ossa] @$s4test0A20GlobalActorFuncValueyyyyAA03RedC0VYcXEYaF -// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none +// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none // CHECK: hop_to_executor [[GENERIC_EXEC]] : // CHECK: function_ref @$s4test8RedActorV6sharedAA0bC4ImplCvgZ // CHECK: hop_to_executor [[RED:%[0-9]+]] : $RedActorImpl // CHECK-NEXT: end_borrow [[RED]] // CHECK-NEXT: begin_borrow // CHECK-NEXT: apply -// CHECK: hop_to_executor [[GENERIC_EXEC:%[0-9]+]] : $Optional +// CHECK: hop_to_executor [[GENERIC_EXEC:%[0-9]+]] : $Optional func testGlobalActorFuncValue(_ fn: @RedActor () -> Void) async { await fn() } @@ -482,18 +482,18 @@ extension MyActor { func testImplicitAsyncIsolatedParam( i: Int, d: Double, actor: MyActor, otherActor: MyActor ) async { - // CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none + // CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none // CHECK-NEXT: hop_to_executor [[GENERIC_EXEC]] : // CHECK: [[FN1:%.*]] = function_ref @$s4test19acceptIsolatedParamyySi_AA7MyActorCYiSdtF // CHECK-NEXT: hop_to_executor [[ACTOR:%.*]] : $MyActor // CHECK-NEXT: apply [[FN1]](%0, %2, %1) : $@convention(thin) (Int, @sil_isolated @guaranteed MyActor, Double) -> () - // CHECK-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional + // CHECK-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional await acceptIsolatedParam(i, actor, d) // CHECK: [[FN2:%.*]] = function_ref @$s4test7MyActorC13otherIsolatedyySi_ACYiSdtF : $@convention(method) (Int, @sil_isolated @guaranteed MyActor, Double, @guaranteed MyActor) -> () // CHECK-NEXT: hop_to_executor [[ACTOR:%.*]] : $MyActor // CHECK-NEXT: apply [[FN2]](%0, %2, %1, %3) : $@convention(method) (Int, @sil_isolated @guaranteed MyActor, Double, @guaranteed MyActor) -> () - // CHECK-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional + // CHECK-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional await otherActor.otherIsolated(i, actor, d) } diff --git a/test/SILGen/hop_to_executor_async_prop.swift b/test/SILGen/hop_to_executor_async_prop.swift index 979725b0769..b86bb550c1b 100644 --- a/test/SILGen/hop_to_executor_async_prop.swift +++ b/test/SILGen/hop_to_executor_async_prop.swift @@ -81,7 +81,7 @@ struct GlobalCat { // CHECK-LABEL: sil hidden [ossa] @$s4test015accessSweaterOfC03catAA0C0VAA3CatC_tYaF : $@convention(thin) @async (@guaranteed Cat) -> @owned Sweater { // CHECK: bb0([[CAT:%[0-9]+]] : @guaranteed $Cat): -// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none +// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none // CHECK: hop_to_executor [[GENERIC_EXEC]] : // CHECK: [[CAT_GETTER:%[0-9]+]] = class_method [[CAT]] : $Cat, #Cat.computedSweater!getter : (isolated Cat) -> () -> Sweater, $@convention(method) (@sil_isolated @guaranteed Cat) -> @owned Sweater // CHECK: hop_to_executor [[CAT]] : $Cat @@ -110,7 +110,7 @@ func accessSweaterOfSweater(cat : Cat) async -> Sweater { // CHECK-LABEL: sil hidden [ossa] @$s4test26accessGlobalIsolatedMember3catSSAA3CatC_tYaF : $@convention(thin) @async (@guaranteed Cat) -> @owned String { // CHECK: bb0([[CAT:%[0-9]+]] : @guaranteed $Cat): -// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none +// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none // CHECK: hop_to_executor [[GENERIC_EXEC]] : // CHECK: [[GETTER:%[0-9]+]] = class_method [[CAT]] : $Cat, #Cat.leader!getter : (Cat) -> () -> String, $@convention(method) (@guaranteed Cat) -> @owned String @@ -443,21 +443,21 @@ struct Container { @GlobalCat var isoRef: CatBox = CatBox() // CHECK-LABEL: sil hidden [ossa] @$s4test9ContainerV12accessTuple1SfyYaF : $@convention(method) @async (@guaranteed Container) -> Float { - // CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none + // CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none // CHECK: hop_to_executor [[GENERIC_EXEC]] : // CHECK: hop_to_executor {{%[0-9]+}} : $MainActor // CHECK: [[ACCESS:%[0-9]+]] = begin_access [read] [dynamic] {{%[0-9]+}} : $*(Optional<(Int, Int)>, Float) // CHECK: [[ADDR:%[0-9]+]] = tuple_element_addr [[ACCESS]] : $*(Optional<(Int, Int)>, Float), 1 // CHECK: {{%[0-9]+}} = load [trivial] [[ADDR]] : $*Float // CHECK: end_access [[ACCESS]] : $*(Optional<(Int, Int)>, Float) - // CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional + // CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional // CHECK: } // end sil function '$s4test9ContainerV12accessTuple1SfyYaF' func accessTuple1() async -> Float { return await globalCircle.1 } // CHECK-LABEL: sil hidden [ossa] @$s4test9ContainerV12accessTuple2SiSgyYaFZ : $@convention(method) @async (@thin Container.Type) -> Optional { - // CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none + // CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none // CHECK: hop_to_executor [[GENERIC_EXEC]] : // CHECK: hop_to_executor {{%[0-9]+}} : $MainActor // CHECK: [[ACCESS:%[0-9]+]] = begin_access [read] [dynamic] {{%[0-9]+}} : $*(Optional<(Int, Int)>, Float) @@ -473,37 +473,37 @@ struct Container { // CHECK: [[ELM_ADDR:%[0-9]+]] = tuple_element_addr [[TUPLE_ADDR]] : $*(Int, Int), 0 // CHECK: {{%[0-9]+}} = load [trivial] [[ELM_ADDR]] : $*Int // CHECK: end_access [[ACCESS]] : $*(Optional<(Int, Int)>, Float) - // CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional + // CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional // CHECK: } // end sil function '$s4test9ContainerV12accessTuple2SiSgyYaFZ' static func accessTuple2() async -> Int? { return await globalCircle.0!.0 } // CHECK-LABEL: sil hidden [ossa] @$s4test9ContainerV12accessTuple3SfyYaF : $@convention(method) @async (@guaranteed Container) -> Float { - // CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none + // CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none // CHECK: hop_to_executor [[GENERIC_EXEC]] : // CHECK: [[ADDRESS_ACCESSOR:%[0-9]+]] = function_ref @$s4test9ContainerV12staticCircleSi_SitSg_Sftvau : $@convention(thin) () -> Builtin.RawPointer // CHECK: hop_to_executor {{%[0-9]+}} : $MainActor // CHECK: = apply [[ADDRESS_ACCESSOR]]() : $@convention(thin) () -> Builtin.RawPointer - // CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional + // CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional // CHECK: hop_to_executor {{%[0-9]+}} : $MainActor // CHECK: [[ACCESS:%[0-9]+]] = begin_access [read] [dynamic] {{%[0-9]+}} : $*(Optional<(Int, Int)>, Float) // CHECK: [[ADDR:%[0-9]+]] = tuple_element_addr [[ACCESS]] : $*(Optional<(Int, Int)>, Float), 1 // CHECK: {{%[0-9]+}} = load [trivial] [[ADDR]] : $*Float // CHECK: end_access [[ACCESS]] : $*(Optional<(Int, Int)>, Float) - // CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional + // CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional // CHECK: } // end sil function '$s4test9ContainerV12accessTuple3SfyYaF' func accessTuple3() async -> Float { return await Container.staticCircle.1 } // CHECK-LABEL: sil hidden [ossa] @$s4test9ContainerV12accessTuple4SiSgyYaFZ : $@convention(method) @async (@thin Container.Type) -> Optional { - // CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none + // CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none // CHECK: hop_to_executor [[GENERIC_EXEC]] : // CHECK: [[ADDRESS_ACCESSOR:%[0-9]+]] = function_ref @$s4test9ContainerV12staticCircleSi_SitSg_Sftvau : $@convention(thin) () -> Builtin.RawPointer // CHECK: hop_to_executor {{%[0-9]+}} : $MainActor // CHECK: = apply [[ADDRESS_ACCESSOR]]() : $@convention(thin) () -> Builtin.RawPointer - // CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional + // CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional // CHECK: hop_to_executor {{%[0-9]+}} : $MainActor // CHECK: [[ACCESS:%[0-9]+]] = begin_access [read] [dynamic] {{%[0-9]+}} : $*(Optional<(Int, Int)>, Float) // CHECK: [[ADDR:%[0-9]+]] = tuple_element_addr [[ACCESS]] : $*(Optional<(Int, Int)>, Float), 0 @@ -518,7 +518,7 @@ struct Container { // CHECK: [[ELM_ADDR:%[0-9]+]] = tuple_element_addr [[TUPLE_ADDR]] : $*(Int, Int), 0 // CHECK: {{%[0-9]+}} = load [trivial] [[ELM_ADDR]] : $*Int // CHECK: end_access [[ACCESS]] : $*(Optional<(Int, Int)>, Float) - // CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional + // CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional // CHECK: } // end sil function '$s4test9ContainerV12accessTuple4SiSgyYaFZ' static func accessTuple4() async -> Int? { return await Container.staticCircle.0!.0 @@ -526,16 +526,16 @@ struct Container { // CHECK-LABEL: sil hidden [ossa] @$s4test9ContainerV8getCountSiyYaFZ : $@convention(method) @async (@thin Container.Type) -> Int { - // CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none + // CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none // CHECK: hop_to_executor [[GENERIC_EXEC]] : // CHECK: [[ADDRESS_ACCESSOR:%[0-9]+]] = function_ref @$s4test9ContainerV7counterSivau : $@convention(thin) () -> Builtin.RawPointer // CHECK: hop_to_executor {{%[0-9]+}} : $MainActor // CHECK: = apply [[ADDRESS_ACCESSOR]]() : $@convention(thin) () -> Builtin.RawPointer - // CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional + // CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional // CHECK: hop_to_executor {{%[0-9]+}} : $MainActor // CHECK: {{%[0-9]+}} = begin_access [read] [dynamic] {{%[0-9]+}} : $*Int // CHECK: {{%[0-9]+}} = load [trivial] {{%[0-9]+}} : $*Int - // CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional + // CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional // CHECK: } // end sil function '$s4test9ContainerV8getCountSiyYaFZ' static func getCount() async -> Int { return await counter @@ -544,12 +544,12 @@ struct Container { // CHECK-LABEL: sil hidden [ossa] @$s4test9ContainerV8getValueSiSgyYaFZ : $@convention(method) @async (@thin Container.Type) -> Optional { // CHECK: bb0(%0 : $@thin Container.Type): - // CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none + // CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none // CHECK: hop_to_executor [[GENERIC_EXEC]] : // CHECK: [[ADDRESS_ACCESSOR:%[0-9]+]] = function_ref @$s4test9ContainerV4thisACSgvau : $@convention(thin) () -> Builtin.RawPointer // CHECK: hop_to_executor {{%[0-9]+}} : $MainActor // CHECK: = apply [[ADDRESS_ACCESSOR]]() : $@convention(thin) () -> Builtin.RawPointer - // CHECK: hop_to_executor {{%[0-9]+}} : $Optional + // CHECK: hop_to_executor {{%[0-9]+}} : $Optional // CHECK: [[MAIN:%[0-9]+]] = begin_borrow {{%[0-9]+}} : $MainActor // CHECK: hop_to_executor [[MAIN]] : $MainActor // CHECK: [[ACCESS:%[0-9]+]] = begin_access [read] [dynamic] {{%[0-9]+}} : $*Optional @@ -558,11 +558,11 @@ struct Container { // CHECK: [[TRUE_BB]]: // CHECK: {{%[0-9]+}} = load [trivial] {{%[0-9]+}} : $*Int // CHECK: end_access [[ACCESS]] : $*Optional - // CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional + // CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional // // CHECK: [[FALSE_BB]]: // CHECK: end_access [[ACCESS]] : $*Optional - // CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional + // CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional // // CHECK: } // end sil function '$s4test9ContainerV8getValueSiSgyYaFZ' static func getValue() async -> Int? { @@ -571,12 +571,12 @@ struct Container { // CHECK-LABEL: sil hidden [ossa] @$s4test9ContainerV10getOrCrashSfyYaFZ : $@convention(method) @async (@thin Container.Type) -> Float { // CHECK: bb0({{%[0-9]+}} : $@thin Container.Type): - // CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none + // CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none // CHECK: hop_to_executor [[GENERIC_EXEC]] : // CHECK: [[ADDRESS_ACCESSOR:%[0-9]+]] = function_ref @$s4test9ContainerV4thisACSgvau : $@convention(thin) () -> Builtin.RawPointer // CHECK: hop_to_executor {{%[0-9]+}} : $MainActor // CHECK: = apply [[ADDRESS_ACCESSOR]]() : $@convention(thin) () -> Builtin.RawPointer - // CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional + // CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional // CHECK: hop_to_executor {{%.*}} : $MainActor // CHECK: [[ACCESS:%[0-9]+]] = begin_access [read] [dynamic] {{%[0-9]+}} : $*Optional // CHECK: switch_enum_addr [[ACCESS]] : $*Optional, case #Optional.some!enumelt: [[SOME_BB:bb[0-9]+]], case #Optional.none!enumelt: [[CRASH_BB:bb[0-9]+]] @@ -597,12 +597,12 @@ struct Container { // CHECK-LABEL: sil hidden [ossa] @$s4test9ContainerV13getRefOrCrashAA6CatBoxCyYaFZ : $@convention(method) @async (@thin Container.Type) -> @owned CatBox { // CHECK: bb0({{%[0-9]+}} : $@thin Container.Type): - // CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none + // CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none // CHECK: hop_to_executor [[GENERIC_EXEC]] : // CHECK: [[ADDRESS_ACCESSOR:%[0-9]+]] = function_ref @$s4test9ContainerV4thisACSgvau : $@convention(thin) () -> Builtin.RawPointer // CHECK: hop_to_executor {{%[0-9]+}} : $MainActor // CHECK: = apply [[ADDRESS_ACCESSOR]]() : $@convention(thin) () -> Builtin.RawPointer - // CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional + // CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional // CHECK: hop_to_executor {{%.*}} : $MainActor // CHECK: [[ACCESS:%[0-9]+]] = begin_access [read] [dynamic] {{%[0-9]+}} : $*Optional // CHECK: switch_enum_addr [[ACCESS]] : $*Optional, case #Optional.some!enumelt: [[SOME_BB:bb[0-9]+]], case #Optional.none!enumelt: [[CRASH_BB:bb[0-9]+]] @@ -642,18 +642,18 @@ struct Blah { // closure #1 in Blah.test() // CHECK-LABEL: sil private [ossa] @$s4test4BlahVAAyyFyyYacfU_ : $@convention(thin) @async @substituted <τ_0_0> (@guaranteed Optional, Blah) -> @out τ_0_0 for <()> { - // CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none + // CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none // CHECK: hop_to_executor [[GENERIC_EXEC]] : // CHECK: hop_to_executor {{%[0-9]+}} : $MainActor // CHECK: [[ACTOR_OBJ_RAW:%[0-9]+]] = apply {{%[0-9]+}}({{%[0-9]+}}) : $@convention(method) (Blah) -> @owned Coordinator - // CHECK: hop_to_executor {{%[0-9]+}} : $Optional + // CHECK: hop_to_executor {{%[0-9]+}} : $Optional // CHECK: [[ACTOR_OBJ:%[0-9]+]] = begin_borrow [[ACTOR_OBJ_RAW]] : $Coordinator // CHECK: [[VAL:%[0-9]+]] = ref_element_addr [[ACTOR_OBJ]] : $Coordinator, #Coordinator.someValue // CHECK: hop_to_executor [[ACTOR_OBJ]] // CHECK: [[VAL_ACCESS:%[0-9]+]] = begin_access [read] [dynamic] [[VAL]] : $*Optional // CHECK: {{%[0-9]+}} = load [trivial] [[VAL_ACCESS]] : $*Optional // CHECK: end_access [[VAL_ACCESS]] : $*Optional - // CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional + // CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional // CHECK: } // end sil function '$s4test4BlahVAAyyFyyYacfU_' @available(SwiftStdlib 5.1, *) func test() { @@ -677,16 +677,16 @@ class Polar { // CHECK-LABEL: sil hidden{{.*}} @$s4test20accessStaticIsolatedSiyYaF : $@convention(thin) @async () -> Int { -// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none +// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none // CHECK: hop_to_executor [[GENERIC_EXEC]] : // CHECK: [[ADDRESSOR:%[0-9]+]] = function_ref @$s4test5PolarC11temperatureSivau : $@convention(thin) () -> Builtin.RawPointer // CHECK: hop_to_executor {{%.*}} : $MainActor // CHECK-NEXT: [[RAW_ADDR:%[0-9]+]] = apply [[ADDRESSOR]]() : $@convention(thin) () -> Builtin.RawPointer -// CHECK-NEXT: hop_to_executor {{%.*}} : $Optional +// CHECK-NEXT: hop_to_executor {{%.*}} : $Optional // CHECK: [[ADDR:%[0-9]+]] = pointer_to_address [[RAW_ADDR]] : $Builtin.RawPointer to [strict] $*Int // CHECK: hop_to_executor {{%.*}} : $MainActor // CHECK: {{%.*}} = load [trivial] {{%.*}} : $*Int -// CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional +// CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional func accessStaticIsolated() async -> Int { return await Polar.temperature } diff --git a/test/SILGen/isolated_any.swift b/test/SILGen/isolated_any.swift index 5956b01db67..cf4d42ce1cf 100644 --- a/test/SILGen/isolated_any.swift +++ b/test/SILGen/isolated_any.swift @@ -3,7 +3,7 @@ // REQUIRES: asserts // CHECK-LABEL: sil hidden [ossa] @$s4test8callSync2fnyyyYbYAXE_tYaF -// CHECK: [[NIL_EXECUTOR:%.*]] = enum $Optional, #Optional.none +// CHECK: [[NIL_EXECUTOR:%.*]] = enum $Optional, #Optional.none // CHECK-NEXT: hop_to_executor [[NIL_EXECUTOR]] // CHECK-NEXT: [[FN_COPY:%.*]] = copy_value %0 : $@isolated(any) @noescape @Sendable @callee_guaranteed () -> () // CHECK-NEXT: [[FN_BORROW1:%.*]] = begin_borrow [[FN_COPY]] : @@ -19,7 +19,7 @@ func callSync(fn: @isolated(any) @Sendable () -> ()) async { } // CHECK-LABEL: sil hidden [ossa] @$s4test9callAsync2fnyyyYaYbYAXE_tYaF -// CHECK: [[NIL_EXECUTOR:%.*]] = enum $Optional, #Optional.none +// CHECK: [[NIL_EXECUTOR:%.*]] = enum $Optional, #Optional.none // CHECK-NEXT: hop_to_executor [[NIL_EXECUTOR]] // CHECK-NEXT: [[FN_COPY:%.*]] = copy_value %0 : $@isolated(any) @noescape @Sendable @async @callee_guaranteed () -> () // CHECK-NEXT: [[FN_BORROW2:%.*]] = begin_borrow [[FN_COPY]] : diff --git a/test/SILGen/objc_async.swift b/test/SILGen/objc_async.swift index bf6eb7a0388..093aa80c646 100644 --- a/test/SILGen/objc_async.swift +++ b/test/SILGen/objc_async.swift @@ -255,7 +255,7 @@ func testThrowingMethodFromMain(slowServer: SlowServer) async -> String { // rdar://91502776 // CHECK-LABEL: sil hidden [ossa] @$s{{.*}}21checkCostcoMembershipSbyYaF : $@convention(thin) @async () -> Bool { // CHECK: bb0: -// CHECK: hop_to_executor {{%.*}} : $Optional +// CHECK: hop_to_executor {{%.*}} : $Optional // CHECK: [[FINAL_BUF:%.*]] = alloc_stack $Bool // CHECK: [[RESULT_BUF:%.*]] = alloc_stack $NSObject // CHECK: [[METH:%.*]] = objc_method {{%.*}} : $@objc_metatype Person.Type, #Person.asCustomer!foreign @@ -264,7 +264,7 @@ func testThrowingMethodFromMain(slowServer: SlowServer) async -> String { // CHECK: dealloc_stack {{%.*}} : $*@block_storage // CHECK: await_async_continuation {{%.*}} : $Builtin.RawUnsafeContinuation, resume bb1 // CHECK: bb1: -// CHECK: hop_to_executor {{%.*}} : $Optional +// CHECK: hop_to_executor {{%.*}} : $Optional // CHECK: [[RESULT:%.*]] = load [take] [[RESULT_BUF]] : $*NSObject // CHECK: objc_method {{%.*}} : $CostcoManager, #CostcoManager.isCustomerEnrolled!foreign // CHECK: get_async_continuation_addr Bool, [[FINAL_BUF]] : $*Bool @@ -275,7 +275,7 @@ func testThrowingMethodFromMain(slowServer: SlowServer) async -> String { // CHECK: dealloc_stack [[BLOCK_STORAGE]] : $*@block_storage // CHECK: await_async_continuation {{%.*}} : $Builtin.RawUnsafeContinuation, resume bb2 // CHECK: bb2: -// CHECK: hop_to_executor {{%.*}} : $Optional +// CHECK: hop_to_executor {{%.*}} : $Optional // CHECK: [[ANSWER:%.*]] = load [trivial] [[FINAL_BUF]] : $*Bool // CHECK: fix_lifetime [[EXTEND2]] : $CostcoManager // CHECK: destroy_value [[EXTEND2]] : $CostcoManager @@ -325,7 +325,7 @@ extension OptionalMemberLookups { // CHECK: destroy_value {{.*}} : $MainActor // CHECK: dealloc_stack {{.*}} : $*AutoreleasingUnsafeMutablePointer> // CHECK: dealloc_stack {{.*}} : $*@sil_unmanaged Optional -// CHECK: hop_to_executor {{.*}} : $Optional +// CHECK: hop_to_executor {{.*}} : $Optional // CHECK: switch_enum func checkHotdogs(_ v: some HotdogCompetitor, _ timeLimit: NSObject) async throws -> String? { return try await v.pileOfHotdogsToEat(withLimit: timeLimit) diff --git a/test/SILGen/objc_async_checked.swift b/test/SILGen/objc_async_checked.swift index d716256c1b9..ff491ef76f7 100644 --- a/test/SILGen/objc_async_checked.swift +++ b/test/SILGen/objc_async_checked.swift @@ -306,7 +306,7 @@ func testThrowingMethodFromMain(slowServer: SlowServer) async -> String { // rdar://91502776 // CHECK-LABEL: sil hidden [ossa] @$s{{.*}}21checkCostcoMembershipSbyYaF : $@convention(thin) @async () -> Bool { // CHECK: bb0: -// CHECK: hop_to_executor {{%.*}} : $Optional +// CHECK: hop_to_executor {{%.*}} : $Optional // CHECK: [[FINAL_BUF:%.*]] = alloc_stack $Bool // CHECK: [[RESULT_BUF:%.*]] = alloc_stack $NSObject // CHECK: [[METH:%.*]] = objc_method {{%.*}} : $@objc_metatype Person.Type, #Person.asCustomer!foreign @@ -317,7 +317,7 @@ func testThrowingMethodFromMain(slowServer: SlowServer) async -> String { // CHECK: dealloc_stack {{%.*}} : $*@block_storage // CHECK: await_async_continuation {{%.*}} : $Builtin.RawUnsafeContinuation, resume bb1 // CHECK: bb1: -// CHECK: hop_to_executor {{%.*}} : $Optional +// CHECK: hop_to_executor {{%.*}} : $Optional // CHECK: [[RESULT:%.*]] = load [take] [[RESULT_BUF]] : $*NSObject // CHECK: objc_method {{%.*}} : $CostcoManager, #CostcoManager.isCustomerEnrolled!foreign // CHECK: get_async_continuation_addr Bool, [[FINAL_BUF]] : $*Bool @@ -328,7 +328,7 @@ func testThrowingMethodFromMain(slowServer: SlowServer) async -> String { // CHECK: dealloc_stack [[BLOCK_STORAGE]] : $*@block_storage // CHECK: await_async_continuation {{%.*}} : $Builtin.RawUnsafeContinuation, resume bb2 // CHECK: bb2: -// CHECK: hop_to_executor {{%.*}} : $Optional +// CHECK: hop_to_executor {{%.*}} : $Optional // CHECK: [[ANSWER:%.*]] = load [trivial] [[FINAL_BUF]] : $*Bool // CHECK: fix_lifetime [[EXTEND2]] : $CostcoManager // CHECK: destroy_value [[EXTEND2]] : $CostcoManager diff --git a/test/SILGen/objc_async_from_swift.swift b/test/SILGen/objc_async_from_swift.swift index 6e8b2fc9b78..d5ba99e9dae 100644 --- a/test/SILGen/objc_async_from_swift.swift +++ b/test/SILGen/objc_async_from_swift.swift @@ -20,7 +20,7 @@ import ObjCConcurrency // CHECK-LABEL: sil {{.*}}@{{.*}}15testSlowServing func testSlowServing(p: SlowServing) async throws { // CHECK-NN: bb0([[HOP_TARGET:%.*]] : @guaranteed $Optional, - // CHECK-C: [[HOP_TARGET:%.*]] = enum $Optional, #Optional.none + // CHECK-C: [[HOP_TARGET:%.*]] = enum $Optional, #Optional.none // CHECK: hop_to_executor [[HOP_TARGET]] : // CHECK: objc_method {{.*}} $@convention(objc_method) <τ_0_0 where τ_0_0 : SlowServing> (@convention(block) (Int) -> (), τ_0_0) -> () // CHECK: hop_to_executor [[HOP_TARGET]] : @@ -44,7 +44,7 @@ func testSlowServing(p: SlowServing) async throws { // CHECK-LABEL: sil {{.*}}@{{.*}}20testSlowServingAgain func testSlowServingAgain(p: SlowServing) async throws { // CHECK-NN: bb0([[HOP_TARGET:%.*]] : @guaranteed $Optional, - // CHECK-C: [[HOP_TARGET:%.*]] = enum $Optional, #Optional.none + // CHECK-C: [[HOP_TARGET:%.*]] = enum $Optional, #Optional.none // CHECK: hop_to_executor [[HOP_TARGET]] : // CHECK: objc_method {{.*}} $@convention(objc_method) <τ_0_0 where τ_0_0 : SlowServing> (@convention(block) (Optional, Optional) -> (), τ_0_0) -> () // CHECK: hop_to_executor [[HOP_TARGET]] : @@ -56,7 +56,7 @@ func testSlowServingAgain(p: SlowServing) async throws { class SlowSwiftServer: NSObject, SlowServing { // CHECK-LABEL: sil {{.*}} @$s21objc_async_from_swift15SlowSwiftServerC10requestIntSiyYaF // CHECK-NN: bb0([[HOP_TARGET:%.*]] : @guaranteed $Optional, - // CHECK-C: [[HOP_TARGET:%.*]] = enum $Optional, #Optional.none + // CHECK-C: [[HOP_TARGET:%.*]] = enum $Optional, #Optional.none // CHECK: hop_to_executor [[HOP_TARGET]] : // CHECK: } // end sil function '$s21objc_async_from_swift15SlowSwiftServerC10requestIntSiyYaF{{.*}}' // CHECK-LABEL: sil private {{.*}} @${{.*}}10requestInt{{.*}}To : @@ -75,11 +75,11 @@ class SlowSwiftServer: NSObject, SlowServing { func requestString() async -> String { return "" } // CHECK-LABEL: sil {{.*}} @$s21objc_async_from_swift15SlowSwiftServerC13requestStringSSyYaF // CHECK-NN: bb0([[HOP_TARGET:%.*]] : @guaranteed $Optional, - // CHECK-C: [[HOP_TARGET:%.*]] = enum $Optional, #Optional.none + // CHECK-C: [[HOP_TARGET:%.*]] = enum $Optional, #Optional.none // CHECK: hop_to_executor [[HOP_TARGET]] : // CHECK-LABEL: sil {{.*}} @$s21objc_async_from_swift15SlowSwiftServerC16tryRequestStringSSyYaKF // CHECK-NN: bb0([[HOP_TARGET:%.*]] : @guaranteed $Optional, - // CHECK-C: [[HOP_TARGET:%.*]] = enum $Optional, #Optional.none + // CHECK-C: [[HOP_TARGET:%.*]] = enum $Optional, #Optional.none // CHECK: hop_to_executor [[HOP_TARGET]] : // CHECK-LABEL: sil shared {{.*}} @${{.*}}16tryRequestString{{.*}}U_To : // CHECK: [[BLOCK_COPY:%.*]] = copy_block %0 @@ -96,13 +96,13 @@ class SlowSwiftServer: NSObject, SlowServing { // CHECK-LABEL: sil {{.*}} @$s21objc_async_from_swift15SlowSwiftServerC19requestIntAndStringSi_SStyYaF // CHECK-NN: bb0([[HOP_TARGET:%.*]] : @guaranteed $Optional, - // CHECK-C: [[HOP_TARGET:%.*]] = enum $Optional, #Optional.none + // CHECK-C: [[HOP_TARGET:%.*]] = enum $Optional, #Optional.none // CHECK: hop_to_executor [[HOP_TARGET]] : func requestIntAndString() async -> (Int, String) { return (0, "") } // CHECK-LABEL: sil {{.*}} @$s21objc_async_from_swift15SlowSwiftServerC22tryRequestIntAndStringSi_SStyYaKF // CHECK-NN: bb0([[HOP_TARGET:%.*]] : @guaranteed $Optional, - // CHECK-C: [[HOP_TARGET:%.*]] = enum $Optional, #Optional.none + // CHECK-C: [[HOP_TARGET:%.*]] = enum $Optional, #Optional.none // CHECK: hop_to_executor [[HOP_TARGET]] : func tryRequestIntAndString() async throws -> (Int, String) { return (0, "") } } @@ -205,7 +205,7 @@ class SlowServerlet: SlowServer { // // CHECK-C-LABEL: sil hidden [ossa] @$s21objc_async_from_swift13SlowServerletC011doSomethingE8NullablyySiSSYaF : $@convention(method) @async (@guaranteed String, @guaranteed SlowServerlet) -> Int // CHECK-C-NOT: bb0([[ACTOR:%.*]] : @guaranteed $Optional - // CHECK-C: [[ACTOR:%.*]] = enum $Optional, #Optional.none!enumelt + // CHECK-C: [[ACTOR:%.*]] = enum $Optional, #Optional.none!enumelt // CHECK-C: hop_to_executor [[ACTOR]] // CHECK-C: // end sil function '$s21objc_async_from_swift13SlowServerletC011doSomethingE8NullablyySiSSYaF' @@ -236,7 +236,7 @@ class SlowServerlet: SlowServer { // // CHECK-C-LABEL: sil hidden [ossa] @$s21objc_async_from_swift13SlowServerletC18findAnswerNullablyyS2SYaF : $@convention(method) @async (@guaranteed String, @guaranteed SlowServerlet) -> @owned String // CHECK-C-NOT: bb0([[ACTOR:%.*]] : @guaranteed $Optional - // CHECK-C: [[ACTOR:%.*]] = enum $Optional, #Optional.none!enumelt + // CHECK-C: [[ACTOR:%.*]] = enum $Optional, #Optional.none!enumelt // CHECK-C-NEXT: hop_to_executor [[ACTOR]] // CHECK-C: } // end sil function '$s21objc_async_from_swift13SlowServerletC18findAnswerNullablyyS2SYaF' @@ -263,7 +263,7 @@ class SlowServerlet: SlowServer { // // CHECK-C-LABEL: sil hidden [ossa] @$s21objc_async_from_swift13SlowServerletC28doSomethingDangerousNullablyyS2SYaKF : $@convention(method) @async (@guaranteed String, @guaranteed SlowServerlet) -> (@owned String, @error any Error) // CHECK-C-NOT: bb0([[ACTOR:%.*]] : @guaranteed $Optional, - // CHECK-C: [[ACTOR:%.*]] = enum $Optional, #Optional.none!enumelt + // CHECK-C: [[ACTOR:%.*]] = enum $Optional, #Optional.none!enumelt // CHECK-C-NEXT: hop_to_executor [[ACTOR]] // CHECK-C: } // end sil function '$s21objc_async_from_swift13SlowServerletC28doSomethingDangerousNullablyyS2SYaKF' @@ -291,7 +291,7 @@ class SlowServerlet: SlowServer { // // CHECK-C-LABEL: sil hidden [ossa] @$s21objc_async_from_swift13SlowServerletC30doSomethingUnspecifiedNullablySSyYaKF : $@convention(method) @async (@guaranteed SlowServerlet) -> (@owned String, @error any Error) // CHECK-C-NOT: bb0([[ACTOR:%.*]] : @guaranteed $Optional, - // CHECK-C: [[ACTOR:%.*]] = enum $Optional, #Optional.none!enumelt + // CHECK-C: [[ACTOR:%.*]] = enum $Optional, #Optional.none!enumelt // CHECK-C-NEXT: hop_to_executor [[ACTOR]] // CHECK-C: } // end sil function '$s21objc_async_from_swift13SlowServerletC30doSomethingUnspecifiedNullablySSyYaKF' @@ -317,7 +317,7 @@ class SlowServerlet: SlowServer { // // CHECK-C-LABEL: sil hidden [ossa] @$s21objc_async_from_swift13SlowServerletC17doSomethingFlaggySSyYaKF : $@convention(method) @async (@guaranteed SlowServerlet) -> (@owned String, @error any Error) // CHECK-C-NOT: bb0([[ACTOR:%.*]] : @guaranteed $Optional, - // CHECK-C: [[ACTOR:%.*]] = enum $Optional, #Optional.none!enumelt + // CHECK-C: [[ACTOR:%.*]] = enum $Optional, #Optional.none!enumelt // CHECK-C-NEXT: hop_to_executor [[ACTOR]] // CHECK-C: } // end sil function '$s21objc_async_from_swift13SlowServerletC17doSomethingFlaggySSyYaKF' @@ -349,7 +349,7 @@ class SlowServerlet: SlowServer { // // CHECK-C-LABEL: sil hidden [ossa] @$s21objc_async_from_swift13SlowServerletC21doSomethingZeroFlaggySSyYaKF : $@convention(method) @async (@guaranteed SlowServerlet) -> (@owned String, @error any Error) // CHECK-C-NOT: bb0([[ACTOR:%.*]] : @guaranteed $Optional, - // CHECK-C: [[ACTOR:%.*]] = enum $Optional, #Optional.none!enumelt + // CHECK-C: [[ACTOR:%.*]] = enum $Optional, #Optional.none!enumelt // CHECK-C-NEXT: hop_to_executor [[ACTOR]] // CHECK-C: } // end sil function '$s21objc_async_from_swift13SlowServerletC21doSomethingZeroFlaggySSyYaKF' // @@ -380,7 +380,7 @@ class SlowServerlet: SlowServer { // // CHECK-C-LABEL: sil hidden [ossa] @$s21objc_async_from_swift13SlowServerletC28doSomethingMultiResultFlaggySS_SStyYaKF : $@convention(method) @async (@guaranteed SlowServerlet) -> (@owned String, @owned String, @error any Error) // CHECK-C-NOT: bb0([[ACTOR:%.*]] : @guaranteed $Optional, - // CHECK-C: [[ACTOR:%.*]] = enum $Optional, #Optional.none!enumelt + // CHECK-C: [[ACTOR:%.*]] = enum $Optional, #Optional.none!enumelt // CHECK-C-NEXT: hop_to_executor [[ACTOR]] // CHECK-C: } // end sil function '$s21objc_async_from_swift13SlowServerletC28doSomethingMultiResultFlaggySS_SStyYaKF' // @@ -561,7 +561,7 @@ func testAutoclosureInStaticMethod() { // // CHECK-C-LABEL: sil private [ossa] @$s21objc_async_from_swift29testAutoclosureInStaticMethodyyF9TestKlassL_C8getValue2id11valueForKeySSSgSS_S2SYaKXEtYaFZ : $@convention(method) @async (@guaranteed String, @guaranteed @noescape @async @callee_guaranteed (@guaranteed String) -> (@owned String, @error any Error), @thick TestKlass.Type) -> @owned Optional { // CHECK-C: bb0([[STRING:%.*]] : @guaranteed $String, [[COMPLETION:%.*]] : @guaranteed $@noescape @async @callee_guaranteed (@guaranteed String) -> (@owned String, @error any Error), [[METATYPE:%.*]] : $@thick TestKlass.Type) - // CHECK-C: [[EXEC_NONE:%.*]] = enum $Optional, #Optional.none!enumelt + // CHECK-C: [[EXEC_NONE:%.*]] = enum $Optional, #Optional.none!enumelt // CHECK-C: hop_to_executor [[EXEC_NONE]] // CHECK-C: hop_to_executor [[EXEC_NONE]] // CHECK-C: hop_to_executor [[EXEC_NONE]] @@ -693,7 +693,7 @@ func testAutoclosureInStaticMethod() { // // CHECK-C-LABEL: sil private [ossa] @$s21objc_async_from_swift29testAutoclosureInStaticMethodyyF9TestKlassL_C17getMainActorValue2id11valueForKeySSSgSS_S2SYaKXEtYaFZ : $@convention(method) @async (@guaranteed String, @guaranteed @noescape @async @callee_guaranteed (@guaranteed String) -> (@owned String, @error any Error), @thick TestKlass.Type) -> @owned Optional { // CHECK-C: bb0([[STRING:%.*]] : @guaranteed $String, [[COMPLETION:%.*]] : @guaranteed $@noescape @async @callee_guaranteed (@guaranteed String) -> (@owned String, @error any Error), [[METATYPE:%.*]] : $@thick TestKlass.Type) - // CHECK-C: [[EXEC_NONE:%.*]] = enum $Optional, #Optional.none!enumelt + // CHECK-C: [[EXEC_NONE:%.*]] = enum $Optional, #Optional.none!enumelt // CHECK-C: hop_to_executor [[EXEC_NONE]] // CHECK-C: hop_to_executor [[EXEC_NONE]] // CHECK-C: hop_to_executor [[EXEC_NONE]] diff --git a/test/SILGen/objc_effectful_properties.swift b/test/SILGen/objc_effectful_properties.swift index 24dba591ecf..bca51d5ea6b 100644 --- a/test/SILGen/objc_effectful_properties.swift +++ b/test/SILGen/objc_effectful_properties.swift @@ -52,7 +52,7 @@ func testAsyncThrows(eff : EffProps) async { // CHECK-LABEL: sil {{.*}}@${{.*}}17testMainActorProp func testMainActorProp(eff : EffProps) async { - // CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none + // CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none // CHECK-NEXT: hop_to_executor [[GENERIC_EXEC]] : // CHECK: hop_to_executor [[GENERIC_EXEC]] : // CHECK: } // end sil function '${{.*}}17testMainActorProp @@ -61,7 +61,7 @@ func testMainActorProp(eff : EffProps) async { // CHECK-LABEL: sil {{.*}}@${{.*}}19testMainActorMethod func testMainActorMethod(eff : EffProps) async { - // CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none + // CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none // CHECK-NEXT: hop_to_executor [[GENERIC_EXEC]] : // CHECK: hop_to_executor [[GENERIC_EXEC]] : // CHECK: } // end sil function '${{.*}}19testMainActorMethod diff --git a/test/SILGen/objc_effectful_properties_checked.swift b/test/SILGen/objc_effectful_properties_checked.swift index 14f891b76b6..31d34d40771 100644 --- a/test/SILGen/objc_effectful_properties_checked.swift +++ b/test/SILGen/objc_effectful_properties_checked.swift @@ -62,7 +62,7 @@ func testAsyncThrows(eff : EffProps) async { // CHECK-LABEL: sil {{.*}}@${{.*}}17testMainActorProp func testMainActorProp(eff : EffProps) async { - // CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none + // CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none // CHECK-NEXT: hop_to_executor [[GENERIC_EXEC]] : // CHECK: hop_to_executor [[GENERIC_EXEC]] : // CHECK: } // end sil function '${{.*}}17testMainActorProp @@ -71,7 +71,7 @@ func testMainActorProp(eff : EffProps) async { // CHECK-LABEL: sil {{.*}}@${{.*}}19testMainActorMethod func testMainActorMethod(eff : EffProps) async { - // CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none + // CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional, #Optional.none // CHECK-NEXT: hop_to_executor [[GENERIC_EXEC]] : // CHECK: hop_to_executor [[GENERIC_EXEC]] : // CHECK: } // end sil function '${{.*}}19testMainActorMethod diff --git a/test/SILOptimizer/consuming_parameter.swift b/test/SILOptimizer/consuming_parameter.swift index 2fb0bd07d24..bcf000d04bc 100644 --- a/test/SILOptimizer/consuming_parameter.swift +++ b/test/SILOptimizer/consuming_parameter.swift @@ -5,7 +5,7 @@ // CHECK-LABEL: sil [ossa] @async_dead_arg_call : {{.*}} { // CHECK: {{bb[0-9]+}}([[INSTANCE:%[^,]+]] : @noImplicitCopy @_eagerMove @owned // CHECK: destroy_value [[INSTANCE]] -// CHECK: [[EXECUTOR:%[^,]+]] = enum $Optional, #Optional.none!enumelt +// CHECK: [[EXECUTOR:%[^,]+]] = enum $Optional, #Optional.none!enumelt // CHECK: [[CALLEE:%[^,]+]] = function_ref @async_callee // CHECK: apply [[CALLEE]]() // CHECK: hop_to_executor [[EXECUTOR]] @@ -18,7 +18,7 @@ public func async_dead_arg_call(o: consuming AnyObject) async { // CHECK-LABEL: sil [ossa] @async_dead_arg_call_lexical : {{.*}} { // CHECK: {{bb[0-9]+}}([[INSTANCE:%[^,]+]] : @noImplicitCopy @_lexical @owned -// CHECK: [[EXECUTOR:%[^,]+]] = enum $Optional, #Optional.none!enumelt +// CHECK: [[EXECUTOR:%[^,]+]] = enum $Optional, #Optional.none!enumelt // CHECK: [[CALLEE:%[^,]+]] = function_ref @async_callee // CHECK: apply [[CALLEE]]() // CHECK: hop_to_executor [[EXECUTOR]] @@ -47,7 +47,7 @@ public class C { // CHECK-LABEL: sil [ossa] @async_dead_arg_call_method : {{.*}} { // CHECK: {{bb[0-9]+}}([[INSTANCE:%[^,]+]] : @noImplicitCopy @_eagerMove @owned // CHECK: destroy_value [[INSTANCE]] - // CHECK: [[EXECUTOR:%[^,]+]] = enum $Optional, #Optional.none!enumelt + // CHECK: [[EXECUTOR:%[^,]+]] = enum $Optional, #Optional.none!enumelt // CHECK: [[CALLEE:%[^,]+]] = function_ref @async_callee : $@convention(thin) @async () -> () // CHECK: apply [[CALLEE]]() : $@convention(thin) @async () -> () // CHECK: hop_to_executor [[EXECUTOR]] diff --git a/test/SILOptimizer/definite_init_actor.swift b/test/SILOptimizer/definite_init_actor.swift index 33e48e2c07b..2666284c593 100644 --- a/test/SILOptimizer/definite_init_actor.swift +++ b/test/SILOptimizer/definite_init_actor.swift @@ -79,7 +79,7 @@ actor BoringActor { // CHECK: bb0([[SELF:%[0-9]+]] : $SingleVarActor): // TODO: We should be able to eliminate this by reasoning that the stores // are to local memory. - // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none + // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none // CHECK-NEXT: hop_to_executor [[GENERIC_EXECUTOR]] // CHECK: [[EI:%.*]] = end_init_let_ref [[SELF]] // CHECK: store {{%[0-9]+}} to [[ACCESS:%[0-9]+]] @@ -96,7 +96,7 @@ actor BoringActor { // CHECK: bb0({{%[0-9]+}} : $Int, [[SELF:%[0-9]+]] : $SingleVarActor): // TODO: We should be able to eliminate this by reasoning that the stores // are to local memory. - // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none + // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none // CHECK-NEXT: hop_to_executor [[GENERIC_EXECUTOR]] // CHECK: [[EI:%.*]] = end_init_let_ref [[SELF]] // CHECK: [[MYVAR_REF:%[0-9]+]] = ref_element_addr [[EI]] : $SingleVarActor, #SingleVarActor.myVar @@ -118,7 +118,7 @@ actor BoringActor { // TODO: We should be able to eliminate this by reasoning that the stores // are to local memory. - // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none + // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none // CHECK-NEXT: hop_to_executor [[GENERIC_EXECUTOR]] // CHECK: [[EI:%.*]] = end_init_let_ref [[SELF]] @@ -150,7 +150,7 @@ actor BoringActor { // TODO: We should be able to eliminate this by reasoning that the stores // are to local memory. - // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none + // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none // CHECK: hop_to_executor [[GENERIC_EXECUTOR]] // CHECK: cond_br {{%[0-9]+}}, [[SUCCESS_BB:bb[0-9]+]], {{bb[0-9]+}} @@ -170,7 +170,7 @@ actor BoringActor { // CHECK: [[SELF_ALLOC:%[0-9]+]] = alloc_stack [lexical] [var_decl] $SingleVarActor, let, name "self" // Initial hop to the generic executor. - // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none + // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none // CHECK-NEXT: hop_to_executor [[GENERIC_EXECUTOR]] // Hop immediately after the call to the synchronous init. @@ -219,7 +219,7 @@ actor DefaultInit { // CHECK: bb0([[SELF:%[0-9]+]] : $DefaultInit): // Initial hop to the generic executor. // TODO: This should be easy to remove. - // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none + // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none // CHECK-NEXT: hop_to_executor [[GENERIC_EXECUTOR]] // CHECK: [[EI:%.*]] = end_init_let_ref [[SELF]] // CHECK: store {{%[0-9]+}} to {{%[0-9]+}} : $*ActingError @@ -231,7 +231,7 @@ actor DefaultInit { // CHECK: bb0({{%[0-9]+}} : $Bool, [[SELF:%[0-9]+]] : $DefaultInit): // Initial hop to the generic executor. // TODO: This should be fairly easy to remove. - // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none + // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none // CHECK-NEXT: hop_to_executor [[GENERIC_EXECUTOR]] // CHECK: [[EI:%.*]] = end_init_let_ref [[SELF]] // CHECK: store {{%[0-9]+}} to {{%[0-9]+}} : $*ActingError @@ -253,7 +253,7 @@ actor MultiVarActor { // CHECK: bb0({{%[0-9]+}} : $Bool, [[SELF:%[0-9]+]] : $MultiVarActor): // Initial hop to the generic executor. // TODO: This should be easy to remove. - // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none + // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none // CHECK-NEXT: hop_to_executor [[GENERIC_EXECUTOR]] // CHECK: [[EI:%.*]] = end_init_let_ref [[SELF]] // CHECK: [[REF:%[0-9]+]] = ref_element_addr [[EI]] : $MultiVarActor, #MultiVarActor.firstVar @@ -271,7 +271,7 @@ actor MultiVarActor { // CHECK-LABEL: sil hidden @$s4test13MultiVarActorC10noSuccCaseACSb_tYacfc : $@convention(method) @async (Bool, @sil_isolated @owned MultiVarActor) -> @owned MultiVarActor { // Initial hop to the generic executor. // TODO: This should be easy to remove. - // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none + // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none // CHECK-NEXT: hop_to_executor [[GENERIC_EXECUTOR]] // CHECK: store {{%[0-9]+}} to [[A1:%[0-9]+]] : $*Int @@ -293,7 +293,7 @@ actor MultiVarActor { // CHECK-LABEL: sil hidden @$s4test13MultiVarActorC10noPredCaseACSb_tYacfc : $@convention(method) @async (Bool, @sil_isolated @owned MultiVarActor) -> @owned MultiVarActor { // Initial hop to the generic executor. // TODO: This should be easy to remove. - // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none + // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none // CHECK-NEXT: hop_to_executor [[GENERIC_EXECUTOR]] // CHECK: store {{%[0-9]+}} to [[ACCESS:%[0-9]+]] : $*Int @@ -316,7 +316,7 @@ actor MultiVarActor { // TODO: We should be able to remove this hop by proving that all the // stores before return are local. We don't really care about invalid // code, of course, but it should fall out. - // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none + // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none // CHECK-NEXT: hop_to_executor [[GENERIC_EXECUTOR]] init?(doesNotFullyInit1: Bool) async { firstVar = 1 @@ -324,7 +324,7 @@ actor MultiVarActor { } // CHECK-LABEL: sil hidden @$s4test13MultiVarActorC17doesNotFullyInit2ACSb_tYacfc - // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none + // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none // CHECK-NEXT: hop_to_executor [[GENERIC_EXECUTOR]] init(doesNotFullyInit2: Bool) async { firstVar = 1 @@ -332,7 +332,7 @@ actor MultiVarActor { } // CHECK-LABEL: sil hidden @$s4test13MultiVarActorC17doesNotFullyInit3ACSb_tYaKcfc - // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none + // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none // CHECK-NEXT: hop_to_executor [[GENERIC_EXECUTOR]] init(doesNotFullyInit3: Bool) async throws { firstVar = 1 @@ -340,7 +340,7 @@ actor MultiVarActor { } // CHECK-LABEL: sil hidden @$s4test13MultiVarActorC17doesNotFullyInit4ACSgSb_tYacfc - // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none + // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none // CHECK-NEXT: hop_to_executor [[GENERIC_EXECUTOR]] init?(doesNotFullyInit4: Bool) async { firstVar = 1 @@ -358,7 +358,7 @@ actor TaskMaster { // CHECK-LABEL: @$s4test10TaskMasterCACyYacfc : $@convention(method) @async (@sil_isolated @owned TaskMaster) -> @owned TaskMaster { // Initial hop to the generic executor. // TODO: This should be easy to remove. - // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none + // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none // CHECK-NEXT: hop_to_executor [[GENERIC_EXECUTOR]] // CHECK: [[ELM:%[0-9]+]] = ref_element_addr [[SELF:%[0-9]+]] : $TaskMaster, #TaskMaster.task @@ -382,7 +382,7 @@ actor SomeActor { // CHECK-LABEL: sil hidden @$s4test9SomeActorCACyYacfc : $@convention(method) @async (@sil_isolated @owned SomeActor) -> @owned SomeActor { // Initial hop to the generic executor. // TODO: This should be easy to remove. - // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none + // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none // CHECK-NEXT: hop_to_executor [[GENERIC_EXECUTOR]] // CHECK-NOT: begin_access @@ -397,7 +397,7 @@ actor Ahmad { // CHECK-LABEL: sil hidden @$s4test5AhmadCACyYacfc : $@convention(method) @async (@owned Ahmad) -> @owned Ahmad { // CHECK: bb0{{.*}}: - // CHECK-NEXT: [[GENERIC:%[0-9]+]] = enum $Optional, #Optional.none!enumelt + // CHECK-NEXT: [[GENERIC:%[0-9]+]] = enum $Optional, #Optional.none!enumelt // CHECK-NEXT: hop_to_executor [[GENERIC]] // CHECK: store {{%[0-9]+}} to {{%[0-9]+}} : $*Int // CHECK: } // end sil function '$s4test5AhmadCACyYacfc' @@ -412,7 +412,7 @@ actor Customer { // CHECK-LABEL: sil hidden @$s4test8CustomerCACyYaKcfc : init() async throws { - // CHECK: [[GENERIC:%[0-9]+]] = enum $Optional, #Optional.none!enumelt + // CHECK: [[GENERIC:%[0-9]+]] = enum $Optional, #Optional.none!enumelt // CHECK-NEXT: hop_to_executor [[GENERIC]] // CHECK: [[SELF:%.*]] = end_init_let_ref %0 : $Customer diff --git a/test/SILOptimizer/definite_init_flow_sensitive_distributed_actor_self.swift b/test/SILOptimizer/definite_init_flow_sensitive_distributed_actor_self.swift index 7aa74dc6a12..d5085743272 100644 --- a/test/SILOptimizer/definite_init_flow_sensitive_distributed_actor_self.swift +++ b/test/SILOptimizer/definite_init_flow_sensitive_distributed_actor_self.swift @@ -13,6 +13,9 @@ distributed actor NotCodableDA // CHECK-LABEL: sil hidden{{.*}}@$s4test12NotCodableDAC11actorSystemACyxGx_tYacfc : $@convention(method) @async (@in ActorSystem, @sil_isolated @owned NotCodableDA) -> @owned NotCodableDA { init(actorSystem: ActorSystem) async { + // CHECK: [[ISOLATION:%.*]] = enum $Optional, #Optional.none!enumelt + // CHECK: hop_to_executor [[ISOLATION]] + self.actorSystem = actorSystem // First use of #isolation, which is replaced by 'nil'. diff --git a/test/embedded/concurrency-builtins.swift b/test/embedded/concurrency-builtins.swift index c133d2342b7..c8480295ebe 100644 --- a/test/embedded/concurrency-builtins.swift +++ b/test/embedded/concurrency-builtins.swift @@ -6,6 +6,7 @@ // REQUIRES: swift_feature_Embedded import Builtin +import _Concurrency public func test() async { _ = Builtin.createAsyncTask(0) { () async throws -> Int in