================
@@ -973,8 +1028,27 @@ void CodeGenFunction::EmitCoroutineBody(const 
CoroutineBodyStmt &S) {
     // shouldn't change the AST.
     if (PreviousRetValue)
       cast<ReturnStmt>(Ret)->setRetValue(PreviousRetValue);
-  }
 
+    if (!GroManager.DirectEmit) {
+      // Send GRO conversion to ConvBB
+      auto *ConvBB =
+          cast<llvm::BranchInst>(PreConvBB->getTerminator())->getSuccessor(0);
+      auto FromIt = ++RetBB->getFirstInsertionPt();
+      auto ToIt = RetBB->getTerminator()->getIterator();
+      ConvBB->splice(ConvBB->getFirstNonPHIIt(), RetBB, FromIt, ToIt);
----------------
ChuanqiXu9 wrote:

Such operations looks dangerous to me. I feel better to see RetBB.split() at 
`ret` and we operates around the splitted new BB.

https://github.com/llvm/llvm-project/pull/151067
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to