[LLVMdev] mov instruction in LLVM IR

Gordon Henriksen gordonhenriksen at me.com
Thu May 28 16:53:15 PDT 2009

On 2009-05-28, at 19:23, Vinod Grover wrote:

> The input language is at assembly level, and the location akin to a  
> %temp ( a virtual register if you will) and contains moves from one  
> virtual to another. Though these are not like memory but I could  
> represent them as local variables and do loads and stores; so I dont  
> know how to represent it in C except as local variables.

Loading from and storing to an alloca is the correct way to model this  
in LLVM IR. In SSA form, variable are immutable—as if all were  
declared 'const' in C. Only memory locations are mutable.

Mid-level optimizations will eliminate the loads and stores to the  
stack slot where possible (i.e., the address of the alloca does not  
escape the function).

— Gordon

More information about the llvm-dev mailing list