Failures Coroutine Optimization

Hey guys, I’ve recently open source a coroutine based library.

We identified couple cases where clang/llvm is not able to optimize away some heap allocations. I was wondering whether there is a way to fix this, either by a workaround, compiler flags or fix in the llvm-optimisation pass.

Here is an link to the compiler explorer:
https://godbolt.org/z/kMEWEO

Feedback highly appreciated.