[PATCH] D132084: [Cloning] handle blockaddress array clone in the same module

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 19 12:21:40 PDT 2022


efriedma added a comment.

In D132084#3735812 <https://reviews.llvm.org/D132084#3735812>, @ychen wrote:

>>> the current situation of silently creating broken IR when cloning blockaddress is not ideal.
>>
>> I'm not sure what invariant we can enforce here.  Maybe something related to the CloneFunctionChangeType?
>
> That's hard in general and feels insufficient to just handle some cases but not the others. How about emitting a warning of sorts all the way back to the frontend if any blockaddress is written? Also, add a boolean flag for CloneFunction API to optionally call IndirectBrExpandPass's logic.

Oh, I was just talking about the API invariant.  Clearly coroutine lowering needs to do something different here.  And probably clang should warn or error if indirect goto can't generate the expected code.

I forget, why do we have to clone the coroutine body?  I think I read an explanation at some point, but I'm not remembering where it was; it seems like it should be possible to avoid cloning.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D132084



More information about the llvm-commits mailing list