[PATCH] D98638: [RFC][Coroutine] Force stack allocation after await_suspend() call

Chuanqi Xu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 16 23:03:24 PDT 2021


ChuanqiXu added inline comments.


================
Comment at: clang/lib/CodeGen/CGCoroutine.cpp:221
     CGF.EmitBlock(RealSuspendBlock);
+  } else if (ForcestackStart) {
+    Builder.CreateCall(
----------------
ChuanqiXu wrote:
> can we rewrite it into:
> ```
> else if (SuspendRet != nullptr && SuspendRet->getType()->isClassType()) {
>      // generate:
>      // llvm.coro.forcestack(SuspendRet)
> }
> ```
Sorry I find we can't did it directly. As you said, we need to traverse down SuspendRet. And I still think we should did it only at CodeGen part since it looks not so hard. I guess we could make it in above 10~15 lines of codes.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D98638/new/

https://reviews.llvm.org/D98638



More information about the cfe-commits mailing list