ChuanqiXu added a comment.

In D131938#3727954 <https://reviews.llvm.org/D131938#3727954>, @ychen wrote:

>> 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?

Yes.

> I'd imagine the branch on a dynamic block address is like `n`-way branch 
> which is not feasible to split. Does/Would it fix the problem by letting the 
> ramp/resume function each have its 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.

The key problem here is that the compiler don't know the idea 'dispatch table'. 
The dispatch table is just a global variable. And coroutines should just leave 
the global variable there just like other global variables.

> "It is only legal to clone a function if a block address within that function 
> is never referenced outside of the function."

This also shows the problem. The coroutines are multiple functions indeed.


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

https://reviews.llvm.org/D131938

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to