[LLVMdev] Re : Re : How to assign a constant to a register?
mwipliez at yahoo.fr
Thu Oct 21 03:13:15 CDT 2010
Yes, because an alloca allocates stack memory for %x, so this means that %x is a
pointer, not a register in SSA form.
So you need to use "load" and "store" to access the contents of the variable and
to modify it respectively (as shown in the "Memory in LLVM" section:
Using local registers is less verbose (because you do not have all those
load/store operations), and is not too hard to generate if you already have a
representation in SSA form.
On the other hand, using loads and stores does not require the SSA form, and the
code will use registers anyway once the mem2reg pass is run.
----- Message d'origine ----
> De : leledumbo <leledumbo_cool at yahoo.co.id>
> À : llvmdev at cs.uiuc.edu
> Envoyé le : Jeu 21 octobre 2010, 8h 19min 53s
> Objet : Re: [LLVMdev] Re : How to assign a constant to a register?
> > If x is a local variable, it will be stored on the stack. So you need an
> > alloca for it:
> Aha, I remember this in Kaleidoscope tutorial. So, after the alloca %x can
> be modified freely (e.g. without adding suffix)?
> View this message in context:
> Sent from the LLVM - Dev mailing list archive at Nabble.com.
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
More information about the LLVMdev