[clang] [llvm] [coro] Lower `llvm.coro.await.suspend.handle` to resume with tail call (PR #89751)
via cfe-commits
cfe-commits at lists.llvm.org
Wed May 15 05:40:54 PDT 2024
================
@@ -206,14 +210,37 @@ static void lowerAwaitSuspend(IRBuilder<> &Builder, CoroAwaitSuspendInst *CB) {
llvm_unreachable("Unexpected coro_await_suspend invocation method");
}
+ if (CB->getCalledFunction()->getIntrinsicID() ==
+ Intrinsic::coro_await_suspend_handle) {
+ // Follow the await_suspend by a lowered resume call to the returned
+ // coroutine.
+ if (auto *Invoke = dyn_cast<InvokeInst>(CB))
+ Builder.SetInsertPoint(Invoke->getNormalDest()->getFirstInsertionPt());
----------------
zmodem wrote:
Yes, I will update the comment.
https://github.com/llvm/llvm-project/pull/89751
More information about the cfe-commits
mailing list