MachineFunction Cloning

Is there a utility somewhere to clone a MachineFunction? I'd like to do a
bunch of complicated transformations and then throw away the results and
restore the initial state if I decide it's not good.

Are there methods to save and restore dataflow information in the same way?
I'm particularly interested in live interval information.

                                           -Dave

Is there a utility somewhere to clone a MachineFunction? I'd like to do a
bunch of complicated transformations and then throw away the results and
restore the initial state if I decide it's not good.

There is a MachineInstr::clone(), but not a MachineFunction::clone(). It's not clear to me whether it is difficult to add.

Are there methods to save and restore dataflow information in the same way?
I'm particularly interested in live interval information.

There is a LiveInterval::Copy(), but that's about it. I think live interval information should be relatively easy to copy though.

Evan