[llvm] [Coroutines] Implement elision for noop coroutines (PR #174353)
Weibo He via llvm-commits
llvm-commits at lists.llvm.org
Sun Jan 11 18:06:35 PST 2026
NewSigma wrote:
Thanks for the code review. I agree with you that CoroElide is designed for coroutine allocation. I worked on CoroElide because
1. The approach requires that we see the `coro.noop` intrinsic, which may be exposed by other middle end optimizations.
2. The pattern is not restricted to presplitcoroutine. Consider:
``` C++
void fn() {
std::noop_coroutine().resume();
}
```
Not sure if there is a realistic use case, though.
I tried to handle await_suspend specifically in CoroSplit, but optimizations do not work well for await_suspend wrappers(*), which is a blocking issue. In this revision, I erase `coro.noop` in CoroCleanup and removed unrelated changes, since CoroCleanup is late in pipeline and works for general functions.
(*) It seems clang forgot to add function attributes to await_suspend wrappers. The inliner refuses to inline callees into await_suspend because their attributes mismatch.
https://github.com/llvm/llvm-project/pull/174353
More information about the llvm-commits
mailing list