Hello everyone, I didn't come across mov or copy in LLVM IR instruction set. So what is the best way to move/copy values between virtual registers? Thanks,Amruth -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120607/76fbe6e3/attachment.html>
Amruth, In general, you should not need to copy values. LLVM IR values are always in SSA form, so there's no difference between a value and the instruction that defines it. Since there is not limit on the number of values, you should never need to copy something. --Owen On Jun 7, 2012, at 1:48 PM, amruth.rd at knights.ucf.edu wrote:> Hello everyone, > > I didn't come across mov or copy in LLVM IR instruction set. So what is the best way to move/copy values between virtual registers? > > Thanks, > Amruth > _______________________________________________ > 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/20120607/761b84a1/attachment.html>
On Thu, Jun 7, 2012 at 1:48 PM, <amruth.rd at knights.ucf.edu> wrote:> Hello everyone, > > I didn't come across mov or copy in LLVM IR instruction set. So what is the > best way to move/copy values between virtual registers?LLVM IR is in SSA (Static Single Assignment) form. In such a form there are no copies/moves - just new virtual registers/values. If you want semantics like that you can alloca and then load/store from memory (mem2reg can them shift that into SSA form).
> From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On Behalf Of amruth.rd at knights.ucf.edu > Subject: [LLVMdev] mov or copy instruction> I didn't come across mov or copy in LLVM IR instruction set. So what is > the best way to move/copy values between virtual registers?LLVM is SSA-based, so such instructions are unnecessary. Every operation creates a new virtual register, distinct from all others. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.