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

Yuanfang Chen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 17 17:12:11 PDT 2022


ychen created this revision.
Herald added a subscriber: hiraditya.
Herald added a project: All.
ychen requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

`CloneFunction.cpp` currently 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 only the case for cloning into the same module (this patch handles this), for cloning/moving into a different module, it is actually okay.

I'm still working on a unit test but want to hear reviewer's opinion earlier since I'm not why it is not handled before, no valid use case or some constraints.

Fixes https://github.com/llvm/llvm-project/issues/56436


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D132084

Files:
  llvm/lib/Transforms/Utils/CloneFunction.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D132084.453479.patch
Type: text/x-patch
Size: 3845 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220818/803f7b51/attachment.bin>


More information about the llvm-commits mailing list