================
@@ -1163,10 +1162,9 @@ static void handleNoSuspendCoroutine(coro::Shape &Shape)
{
auto *CoroBegin = Shape.CoroBegin;
switch (Shape.ABI) {
case coro::ABI::Switch: {
- auto SwitchId = Shape.getSwitchCoroId();
- auto *AllocInst = SwitchId->getCoroAlloc();
- coro::replaceCoroFree(SwitchId, /*Elide=*/AllocInst != nullptr);
----------------
NewSigma wrote:
I think there is no semantic change. Previously, we unconditionally lowered
`coro.free`. Now, we lower it only for the cleanup function. Without
`coro.dead`, the remaining `coro.free` intrinsics are lowered in CoroCleanup
anyway, so this change essentially defers the lowering of `coro.free` to
CoroCleanup. With `coro.dead`, we lower it to null only if resumers are inlined
into the caller and elision is feasible. If resumers are not inlined, we lower
`coro.free` inside them to FramePtr. This is safe because the coroutine cannot
be destroyed twice.
https://github.com/llvm/llvm-project/pull/185336
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits