Description
There is a middle-end optimization called coroutine elision
to elide the dynamic allocation from coroutines. And several issue reports are complaining the compiler failed to optimize their program as expected.
This is not usually what we do for middle-end optimization passes. Since for an optimization pass, it is pretty common to give up optimization opportunities in complex cases. But coroutine elision (or HALO) is different than other middle-end optimizations. It is part of the coroutines semantics in many people's imagination even if it is not formally recorded. Then there is a slight conflict.
To fully address the issue, I think we need involvement from the language side, either formally from WG21 or as a clang extension.
The issue is created to collect different issues/cases/requirements that people want for coroutine elision (or HALO) so that we can handle similar things altogether. The issue reports I see now are including
- coroutine allocation optimization #64193
- [Coroutines] clang fails to apply HALO on a tuple of coroutine objects. #57852
- Clang fails to apply HALO when coroutine is destroyed from await_resume #56972
Feel free to provide more reports or requirements on this page.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status