I have read the article Using Coroutine TS with zero dynamic allocations, and the author insists that HALO would work for coroutines and he provides an godbolt link which shows generator example HALO applied with clang 5.0.
However, with more recent version of clang(clang 13.0.1 on godbolt) I can see calls to operator new. As a matter of fact, I cannot find any recent compiler which supports HALO for corouine. I have tested on MSVC 2019/2022, GCC 11.2 and all assembly shows calls to operator new.
Is it true I can rely on HALO as the author insisted in that article? For instance, RVO was pretty reliable even before C++17 which brings copy ellision into standard. What should I care to expect HALO for my coroutines?
The original example does HALO with -O3, just not with -O2.
Seems like HALO does happen, but depends on additional optimization passes.
All I did was update it to C++20 and stdx -> std.