[LLVMdev] LLVM SSA

Óscar Fuentes ofv at wanadoo.es
Fri Sep 25 21:33:50 PDT 2009


ivtm <martinaide1 at yahoo.com> writes:

> I am wondering if there are options that can be given to LLVM can be used to
> generate code that is not in SSA, but in plain 3-address form ?  (for
> example, if there is an existing pass that does the register allocation and
> dead variable elimination)
>
> For example, if I have:
>
> int x = 0;
>
> void main()
> {
>    x++;
>    x++;
> }
>
> I guess, if that is not the case, then, one needs to write their own pass.

Why do you want to avoid SSA?

SSA on LLVM is much simpler than it seems, the API makes generating SSA
natural, almost not noticing it. Your above example is trivial. Go to
http://www.llvm.org/demo and see how your C/C++ code is translated to
LLVM IR (pay attention to the options available on the web form).

And of course there are passes for register allocation, dead variable
elimination and more.

[snip]

-- 
Óscar




More information about the llvm-dev mailing list