@@ -2529,6 +2529,7 @@ IRGenFunction::createAsyncDispatchFn(const FunctionPointer &fnPtr,
2529
2529
llvm::StringRef (name), &IGM.Module );
2530
2530
dispatch->setCallingConv (IGM.SwiftAsyncCC );
2531
2531
dispatch->setDoesNotThrow ();
2532
+ dispatch->addFnAttr (llvm::Attribute::AlwaysInline);
2532
2533
IRGenFunction dispatchIGF (IGM, dispatch);
2533
2534
// Don't emit debug info if we are generating a function for the prologue.
2534
2535
if (IGM.DebugInfo && Builder.getCurrentDebugLocation ())
@@ -2581,13 +2582,15 @@ void IRGenFunction::emitSuspensionPoint(Explosion &toExecutor,
2581
2582
2582
2583
llvm::Function *IRGenFunction::getOrCreateResumeFromSuspensionFn () {
2583
2584
auto name = " __swift_async_resume_get_context" ;
2584
- return cast<llvm::Function>(IGM.getOrCreateHelperFunction (
2585
+ auto fn = cast<llvm::Function>(IGM.getOrCreateHelperFunction (
2585
2586
name, IGM.Int8PtrTy , {IGM.Int8PtrTy },
2586
2587
[&](IRGenFunction &IGF) {
2587
2588
auto &Builder = IGF.Builder ;
2588
2589
Builder.CreateRet (&*IGF.CurFn ->arg_begin ());
2589
2590
},
2590
2591
false /* isNoInline*/ ));
2592
+ fn->addFnAttr (llvm::Attribute::AlwaysInline);
2593
+ return fn;
2591
2594
}
2592
2595
2593
2596
llvm::Function *IRGenFunction::createAsyncSuspendFn () {
@@ -2612,6 +2615,7 @@ llvm::Function *IRGenFunction::createAsyncSuspendFn() {
2612
2615
name, &IGM.Module );
2613
2616
suspendFn->setCallingConv (IGM.SwiftAsyncCC );
2614
2617
suspendFn->setDoesNotThrow ();
2618
+ suspendFn->addFnAttr (llvm::Attribute::AlwaysInline);
2615
2619
IRGenFunction suspendIGF (IGM, suspendFn);
2616
2620
if (IGM.DebugInfo )
2617
2621
IGM.DebugInfo ->emitOutlinedFunction (suspendIGF, suspendFn,
0 commit comments