[LLVMdev] Copy Instructions?

Prakash Prabhu prakash.prabhu at gmail.com
Wed Jan 28 06:54:42 PST 2009


I dont know if this helps but this sort of an issue apparently crops up
during the un-SSA phase, if copy propagation is done on SSA'ed code.  The
exact problem is mentioned in (the Lost Copy problem) "Practical
Improvements to the Construction and Destruction of Static Single Assignment
Form". Since there is no explicit assignment (copy) instruction in LLVM, I
dont know if this is a problem here.

regards,
Prakash


On Tue, Jan 27, 2009 at 7:28 PM, Eli Friedman <eli.friedman at gmail.com>wrote:

> On Tue, Jan 27, 2009 at 2:54 PM, David Greene <dag at cray.com> wrote:
> > How do I go about creating the copy t = x?  I don't want to use an add
> with a
> > zero constant because it may not be optimized in all circustations
> (floating
> > point, for example).
>
> You can use a no-op bitcast for scalars, but there isn't any reliable
> way to do it for all first-class values.  That said, I don't quite
> follow the issue.  This is SSA, so the only way a value can change is
> if you change the code.
>
> I'm not really following what the issue is in this testcase, though,
> so I could be missing something.  The way you're describing it,
> mem2reg appears to be working as intended; the correct completion is
> in fact as follows:
>         //   x = phi(x.0, expr)
>         //   y = phi(y.0, x)
>
> > In this particular example another solution would be to reorder the phis
> but I
> > don't think that will work in the general case.
>
> PHI nodes don't have an ordering, at least conceptually; they're not
> real instructions.
>
> -Eli
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090128/6e65f4d0/attachment.html>


More information about the llvm-dev mailing list