This is an archive of the discontinued LLVM Phabricator instance.

Cloning: Clean up the interface to the CloneFunction function.
ClosedPublic

Authored by pcc on Mar 30 2016, 3:14 PM.

Details

Summary

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

Diff Detail

Repository
rL LLVM

Event Timeline

pcc updated this revision to Diff 52140.Mar 30 2016, 3:14 PM
pcc retitled this revision from to Cloning: Clean up the interface to the CloneFunction function..
pcc updated this object.
pcc added reviewers: dexonsmith, aprantl.
pcc added subscribers: probinson, eugenis, tejohnson and 2 others.
dexonsmith edited edge metadata.Mar 30 2016, 3:36 PM
dexonsmith added a subscriber: dexonsmith.

+alon.mishne@intel.com, who committed r203662.

This revision was automatically updated to reflect the committed changes.