================ @@ -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:
In that case the Builder's insert point is already in the right place. That's what the "Follow ..." comment refers to. In both cases, we want to follow the await_suspend. It's only for an invoke that we need to jump to the next block. https://github.com/llvm/llvm-project/pull/89751 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits