[LLVMdev] Why clang inlines with -O3 flag and opt doesn't?

Duncan Sands baldrick at free.fr
Fri Sep 3 01:17:39 PDT 2010


Hi Yuri,

> But when I get an equivalent to fib.c file fib.ll and run it through opt with the command 'llvm-as fib.ll&&   opt -O3 fib.bc -o fib-opt.bc&&   llvm-dis fib-opt.bc' resulting fib-opt.ll doesn't have any degree of inlining despite the flag -O3.

perhaps because your hand written .ll has no target information in it.
I'm not sure why that would effect inlining, but in general it vastly
reduces the number of optimizations that can be performed.

Ciao,

Duncan.



More information about the llvm-dev mailing list