mov or copy instruction

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

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

From: llvmdev-bounces@cs.uiuc.edu [mailto:llvmdev-bounces@cs.uiuc.edu] On Behalf Of amruth.rd@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.

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).