[LLVMdev] unoptimised LLVM, not in SSA form

Andrew Lenharth andrewl at lenharth.org
Sat Aug 27 14:43:55 PDT 2005


On Sat, 2005-08-27 at 13:18 +0100, Umar Janjua wrote:
> I am interested in obtaining LLVM IR without any optimization performed on 
> it.( IR obtained from cfrontend's AST). Is this LLVM IR in SSA form?

All LLVM is in SSA form.  However, the cfrontend uses allocs and
explicit loads and stores so it doesn't have to worry about this.  The
pass mem2reg converts the code with memory locations for each variable
into code with variables in virtual registers that are in SSA form.

use 
llvm-gcc -Wa,-disable-opt -Wl,-disable-opt
to have llvm-gcc skip all optimizations.  This is very very ugly code.
You can then run optimization by hand using opt.  See the web pages for
more information there.

>  Secondly, I want to make a transformation on this unoptimized IR, and convert 
> it back to C.  I believe llc -c does that.

llc -march=c does that.

> Thirdly,  is it possible to use LLVM tool suite on LLVM IR that's not in SSA 
> form, if we have such LLVM  so.

LLVM IR is defined as being in SSA form.  It will not verify if it is
not.

Andrew




More information about the llvm-dev mailing list