Closing https://github.com/llvm/llvm-project/issues/56980
Coroutines will be split into pieces, which will complexify the control flow graph. Then the compiler must be conservative to avoid miscompilation. However, there are some cases that the programmer can understand the behavior of their coroutines but they can't pass the information to compiler now. And this patch fixes this.
Currently, the only optimization will reduce the size of the destroy function. I have other ideas but need to be proved. But I think this should be fine enough. For a internal coroutine-heavily-used example, the code sizes reduces 4% after I applied the attribute.