<div dir="ltr"><div>I have this input IR in the final cleanup block of my coroutine:<br><br></div>// call the free function<br><div><div>  call fastcc void %22(%Allocator* %20, %"[]u8"* byval %4), !dbg !244<br><br></div><div>// based on whether this is an early return or a normal return, we want to<br></div><div>// either return to the caller, or resume the handle of the awaiter<br></div><div>  br i1 %19, label %Resume, label %Return, !dbg !244<br><br>Resume:                                           ; preds = %CheckFree<br>  %31 = load i8*, i8** %14, align 8, !dbg !244<br>  call void @llvm.coro.resume(i8* %31), !dbg !244<br><br></div><div>// after resuming the awaiter, we return to the caller<br></div><div>  br label %Return, !dbg !244<br><br>Return:                                           ; preds = %Resume, %CheckFree<br>  ret i8* undef, !dbg !244<br><br><br></div><div>When CoroSplit creates the destroy function for this coroutine, it generates this:<br><br>  call fastcc void %2(%Allocator* %0, %"[]u8"* byval %.reload.addr4), !dbg !296<br>  unreachable<br><br><br></div><div>How did that unreachable get there? What happened to my code above to resume or return to the caller?<br></div></div></div>