================ @@ -1513,6 +1580,11 @@ static void handleNoSuspendCoroutine(coro::Shape &Shape) { // the coroutine and if that is the case we cannot eliminate the suspend point. static bool hasCallsInBlockBetween(Instruction *From, Instruction *To) { for (Instruction *I = From; I != To; I = I->getNextNode()) { + // This one could resume the coroutine, + // but additional analysis before the check should ensure, + // that it can't happen + if (isa<CoroAwaitSuspendInst>(I)) + continue; ---------------- fpasserby wrote:
No, because `CoroAwaitSuspendInst` is not a proper `IntrinsicInst`, because it can be invoked. I'm not sure what else could be done about it (aside from deriving `IntrinisicInst` from `CallBase` instead of `CallInst`). Also it seems like special handling for it should be added to `InlineCost.cpp` and this intrinisic should return true in `mayLowerToFunctionCall`. Callback metadata should probabply be attached to the intrinsic, but I wasn't able to find a way to do it. 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