@@ -2529,6 +2529,7 @@ IRGenFunction::createAsyncDispatchFn(const FunctionPointer &fnPtr,
25292529 llvm::StringRef (name), &IGM.Module );
25302530 dispatch->setCallingConv (IGM.SwiftAsyncCC );
25312531 dispatch->setDoesNotThrow ();
2532+ dispatch->addFnAttr (llvm::Attribute::AlwaysInline);
25322533 IRGenFunction dispatchIGF (IGM, dispatch);
25332534 // Don't emit debug info if we are generating a function for the prologue.
25342535 if (IGM.DebugInfo && Builder.getCurrentDebugLocation ())
@@ -2581,13 +2582,15 @@ void IRGenFunction::emitSuspensionPoint(Explosion &toExecutor,
25812582
25822583llvm::Function *IRGenFunction::getOrCreateResumeFromSuspensionFn () {
25832584 auto name = " __swift_async_resume_get_context" ;
2584- return cast<llvm::Function>(IGM.getOrCreateHelperFunction (
2585+ auto fn = cast<llvm::Function>(IGM.getOrCreateHelperFunction (
25852586 name, IGM.Int8PtrTy , {IGM.Int8PtrTy },
25862587 [&](IRGenFunction &IGF) {
25872588 auto &Builder = IGF.Builder ;
25882589 Builder.CreateRet (&*IGF.CurFn ->arg_begin ());
25892590 },
25902591 false /* isNoInline*/ ));
2592+ fn->addFnAttr (llvm::Attribute::AlwaysInline);
2593+ return fn;
25912594}
25922595
25932596llvm::Function *IRGenFunction::createAsyncSuspendFn () {
@@ -2612,6 +2615,7 @@ llvm::Function *IRGenFunction::createAsyncSuspendFn() {
26122615 name, &IGM.Module );
26132616 suspendFn->setCallingConv (IGM.SwiftAsyncCC );
26142617 suspendFn->setDoesNotThrow ();
2618+ suspendFn->addFnAttr (llvm::Attribute::AlwaysInline);
26152619 IRGenFunction suspendIGF (IGM, suspendFn);
26162620 if (IGM.DebugInfo )
26172621 IGM.DebugInfo ->emitOutlinedFunction (suspendIGF, suspendFn,
0 commit comments