================
@@ -1396,9 +1478,18 @@ static bool simplifySuspendPoint(CoroSuspendInst 
*Suspend,
   if (!SubFn)
     return false;
 
-  // Does not refer to the current coroutine, we cannot do anything with it.
-  if (SubFn->getFrame() != CoroBegin)
-    return false;
+  auto Frame = SubFn->getFrame();
+
+  // Check that frame directly always refers to the current coroutine,
+  // either directly or via wrapper
+  if (Frame != CoroBegin) {
+    auto *AWS = dyn_cast<CoroAwaitSuspendInst>(Frame);
+    if (!AWS)
+      return false;
----------------
ChuanqiXu9 wrote:

Since we've lowered all `CoroAwaitSuspendInst` before invoking 
`splitCoroutine`. We shouldn't see `CoroAwaitSuspendInst` here, right?

Then we can remove  isSimpleWrapper too.

https://github.com/llvm/llvm-project/pull/79712
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to