[PATCH] D131938: [C++20] [Coroutines] Disable to take the address of labels in coroutines

Yuanfang Chen via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 16 21:22:03 PDT 2022


ychen added a comment.

> Since the coroutines are going to split into pieces in the middle end so the address of labels are ambiguous that time.

Do we split in the middle or copy the whole computed goto CFG? I'd imagine the branch on a dynamic block address is like `n`-way branch which is not feasible to split. Does it fix the problem by letting the ramp/result each have their own dispatch table? I skimmed through the blockaddress handling during function cloning which looks insufficient to handle this issue: https://github.com/llvm/llvm-project/blob/e20d210eef92f3952de0e89ef2f01a146480a13b/llvm/lib/Transforms/Utils/CloneFunction.cpp#L177-L182, it says "It is only legal to clone a function if a block address within that function is never referenced outside of the function." . This is not true when the dispatch table is a global variable.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D131938/new/

https://reviews.llvm.org/D131938



More information about the cfe-commits mailing list