[PATCH] D18628: Cloning: Clean up the interface to the CloneFunction function.

Peter Collingbourne via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 30 15:14:50 PDT 2016


pcc created this revision.
pcc added reviewers: dexonsmith, aprantl.
pcc added subscribers: probinson, eugenis, tejohnson, loladiro, llvm-commits.
Herald added a reviewer: tstellarAMD.
Herald added a subscriber: arsenm.

Remove the ModuleLevelChanges argument, and the ability to create new
subprograms for cloned functions. The latter was added without review in
r203662, but it has no in-tree clients (all non-test callers pass false
for ModuleLevelChanges [1], so it isn't reachable outside of tests). It
also isn't clear that adding a duplicate subprogram to the compile unit is
always the right thing to do when cloning a function within a module. If
this functionality comes back it should be accompanied with a more concrete
use case.

Furthermore, all in-tree clients add the returned function to the module.
Since that's pretty much the only sensible thing you can do with the function,
just do that in CloneFunction.

[1] http://llvm-cs.pcc.me.uk/lib/Transforms/Utils/CloneFunction.cpp/rCloneFunction

http://reviews.llvm.org/D18628

Files:
  include/llvm/Transforms/Utils/Cloning.h
  lib/Target/AMDGPU/AMDGPUAlwaysInlinePass.cpp
  lib/Transforms/IPO/PartialInlining.cpp
  lib/Transforms/Utils/CloneFunction.cpp
  unittests/Transforms/Utils/Cloning.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D18628.52140.patch
Type: text/x-patch
Size: 8903 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160330/a28e2546/attachment.bin>


More information about the llvm-commits mailing list