NormalInlining pass run only at > O1

hi,

there's this code in CompilerInvocation.cpp:

  Opts.Inlining = (Opts.OptimizationLevel > 1) ? CodeGenOptions::NormalInlining
     : CodeGenOptions::OnlyAlwaysInlining;

ie. for all optimization levels below -O2 only the OnlyAlwaysInlining pass
is run. why is it so? it makes more sense to me to run NormalInlining
at -O1 too.

can someone shed some light on this?

thank you, roman

Hi Roman,

-O1 is intended to only do simple intraprocedural optimizations. Inlining isn't one of those. What is your use case for -O1?

-Chris

freebsd bootloader. its size is smallest with -O1 + inlining with
-inline-threshold=3

I'll deal with my issue in other way, thnx!

roman

-O1 is intended to only do simple intraprocedural optimizations. Inlining isn't one of those. What is your use case for -O1?

freebsd bootloader. its size is smallest with -O1 + inlining with
-inline-threshold=3

I'll deal with my issue in other way, thnx!

Something is wrong with our -Os :slight_smile:

roman

Cheers,
Rafael