[LLVMdev] Use list preservation when using Instruction::clone
jingyue at google.com
Thu Oct 2 15:26:50 PDT 2014
Doesn't look right. Would you mind attaching the test?
Btw, instead of creating an empty function and CloneFunctionInto, can you
On Thu Oct 02 2014 at 2:47:51 PM Tyler Denniston <tyler at csail.mit.edu>
> I'm trying to create a clone of a function using Function::Create()
> and CloneFunctionInto. However, I'm running into an issue. I believe
> that the instructions in the function clone still have Use edges to
> values in the original function. This is a problem for my purposes.
> For example, consider an original function F. I create a new function
> G belonging to the same module and call CloneFunctionInto(G, F) to
> copy over the function body. Now, consider a phi node p in F, and an
> instruction I in F which uses p. The problem is, the cloned phi node
> p' in G still lists I as a user.
> Is this intended behavior? And if so, is there a way I can remove
> these Use edges in my cloned function?
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev