[LLVMdev] O3 passes

Duncan Sands baldrick at free.fr
Tue Apr 28 00:50:33 PDT 2009


On Tuesday 28 April 2009 09:19:19 am Ryan M. Lefever wrote:
> Can I specify passes that I want run directly to llvm-gcc?  I don't want 
> all of -O3, for example.  I tried llvm-gcc -raiseallocs ..., but that 
> didn't work.  I also tried running cc1 directly and it didn't take 
> -raiseallocs as a parameter either.

You are better off run passes explicitly using opt.  Try this:
  llvm-gcc -c -o - -O1 my_proc.c -emit-llvm -mllvm --disable-llvm-optzns | opt list_of_passes
Passing -O1 to llvm-gcc means that gcc will perform constant folding and
some other small optimizations.  Passing -emit-llvm means that LLVM bitcode
is produced, suitable for piping to opt.  -mllvm --disable-llvm-optzns means
that the LLVM optimizers will not be run.

Ciao,

Duncan.



More information about the llvm-dev mailing list