This is the original idea to solve the TLS problem in coroutines described in https://discourse.llvm.org/t/address-thread-identification-problems-with-coroutine/62015.
The main discussion of the thread is about how should we handle readnone attribute and this is already done in D127383. The here is the other problem about TLS variables.
@jyknight points out that we could solve this problem and the TLS is not a constant problem in one shot and we get in consensus this is the good direction. So I sent D125291 and D129833.
But now clang15 branch is going to be created in the next week and D125291 has no hopes to land before that. It implies that the TLS bug would remain in clang15. I think it is really a pity that the bug has lived for 2 years.
@rjmccall sent concerns about the automatically merge of TLS addresses so that CoroEarly might not be early enough. But both of us failed to give an example. My thought is that the current one might not be perfect and D125291 should be the direction in the future. And the current one is simple enough and workable in most cases. I think we could land this first to fix the bug. I would revert this one if D125291 or any other similar patches get landed. How do you think about the strategy?