[LLVMdev] Cloning Functions

David Greene dag at cray.com
Fri Jul 11 13:55:59 PDT 2008


On Friday 11 July 2008 14:47, David Greene wrote:

> > > The global data is also optimized at this point. Will it map properly
> > > with un-optimized pristine functions ?
> >
> > I had wondered that myself.  In what way is global data optimized?
> > My assumption is that global data might be added by optimizations
> > but that nothing would be deleted or drastically changed.
>
> Hmm...it seems you are right.  When I try to merge the two value maps I
> get a faullt mapping a ConstantValue from one of the pristine Function
> clones.  Apparently this ConstantValue got deleted by optimization
> somewhere.

Ok, so I worked around this by changing the code that merges value
maps and also cloned the whole Module the pristine function is in
each time (I don't actually know if that latter bit is necessary).

Bottom line, I now have complete unoptimized LLVM out!  Yay!

Deleting things and cleaning up is tricky though.

                                               -Dave



More information about the llvm-dev mailing list