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

Yuanfang Chen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 18 12:20:13 PDT 2022


ychen added a comment.

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

> In D132084#3733036 <https://reviews.llvm.org/D132084#3733036>, @ychen wrote:
>
>> In D132084#3732941 <https://reviews.llvm.org/D132084#3732941>, @efriedma wrote:
>>
>>> In general, you can't clone when indirectbrs are involved: since the blockaddress is a constant, it needs to be valid for all the cloned versions of the indirectbr.  And you can't make different basic blocks with the same address.
>>
>> I mean, there are existing VMap for new blockaddress and old blockaddress. So each cloned indirectbr has its own set of blockaddress. For this case, the cloning logic does not apply this VMap to GlobalValue that uses blockaddress. no?
>
> And the side effect is that any  GlobalValue referencing blockaddress needs to be cloned too. Most of the time, this is just an array of blockaddress.

Never mind, I don't think it is legal to clone any GlobalValue here. Only GlobalValue that contains only blockaddress.


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