[LLVMdev] What is the optimization level means?

Eli Friedman eli.friedman at gmail.com
Mon Jun 6 12:07:03 PDT 2011


On Mon, Jun 6, 2011 at 9:49 AM, don <dondum113 at gmail.com> wrote:
> I tried to understand what the difference in optimization level and I got
> confuse...
> When I use llc -O1, -O2, or -O3, I always got the same assembly code in my
> test program.
> Can anybody teach me that what's the actual effect for using different
> optimization level ?

There really isn't a big difference between llc at -O1, -O2, and -O3;
IIRC, some optimizations are slightly more aggressive, but you
normally won't notice much difference.  Most of the differences are in
the IR optimization passes (which can be run with "opt -O3" etc.).

-Eli




More information about the llvm-dev mailing list