[all-commits] [llvm/llvm-project] 1179d6: [mlir][async] Lazily create the coroutine destroy-...
Matthias Springer via All-commits
all-commits at lists.llvm.org
Mon May 25 17:08:49 PDT 2026
Branch: refs/heads/users/matthias-springer/async_dead_code
Home: https://github.com/llvm/llvm-project
Commit: 1179d6d540b36167546a51653b4e1f35577f7e59
https://github.com/llvm/llvm-project/commit/1179d6d540b36167546a51653b4e1f35577f7e59
Author: Matthias Springer <me at m-sp.org>
Date: 2026-05-26 (Tue, 26 May 2026)
Changed paths:
M mlir/lib/Dialect/Async/Transforms/AsyncToAsyncRuntime.cpp
M mlir/test/Dialect/Async/async-to-async-runtime.mlir
Log Message:
-----------
[mlir][async] Lazily create the coroutine destroy-cleanup block
`setupCoroMachinery` previously emitted a `cleanupForDestroy` block
unconditionally, alongside the normal `cleanup` block. That block is
only ever used as the "destroy" successor of an `async.coro.suspend`,
so for coroutines that never suspend (e.g. an `async.func` whose body
contains no `async.await`) it ended up unreachable in the lowered CFG.
Make `cleanupForDestroy` mirror the existing `setError` pattern and
materialize it lazily via a new `setupCleanupForDestroyBlock` helper,
called only from the two places (`outlineExecuteOp` and the
`async.await` lowering) that actually wire it up. Store the coroutine
id on `CoroMachinery` so the helper can rebuild the block contents
without keeping the original `async.coro.id` op around.
Assisted-by: Opus 4.7
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list