Open kelbon opened 2 months ago
@llvm/issue-subscribers-coroutines
Author: None (kelbon)
From the perspective of compilers, there is not a lot of things we can do here.
From the perspective of compilers, there is not a lot of things we can do here.
im about just using internal knowledge about how coroutines implemented and using this information to create a struct without UB, it seems possible
It looks like other optimizations clear such uses somehow... I am not sure why it can't works.
I think there are should be a way to create coroutine frame from lambda. There are use cases:
I have "implementation", but for obvious reasons it is not good: it contains undefined behavior. And i dont know is it intentional, but clang ignores all noinline and std::launder hacks and just optimizes out all code every time (with O1/O2/O3): https://godbolt.org/z/EP1b8Eb9x