Cloning MachineFunctions

Hi Owen,

Looking to the API, I think MachineFunction cloning is something not
taken into consideration (e.g.,
copy-construction is forbidden).

Maybe, you could achieve your goal by building a new MachineFunction
with the provided constructor,
extracting the parameters from the copied MachineFunction, and using the
MachineFunction::getProperties
and MachineFunctionProperties::set() to copy the properties.

Does it work for you? Or did I miss some particular?

Concerning the utility of the cloning function, I do not see it, except
for specific applications. But this
is my personal opinion; someone else with more experience may properly
address your question.

-- Lorenzo

Right, this would work, but I think it would just be the first step. We’d still need to copy all of the blocks, instructions, etc.