[cfe-dev] NormalInlining pass run only at > O1

Roman Divacky rdivacky at freebsd.org
Tue Mar 8 10:31:21 PST 2011


On Tue, Mar 08, 2011 at 09:33:38AM -0800, Chris Lattner wrote:
> 
> On Mar 8, 2011, at 9:09 AM, Roman Divacky wrote:
> 
> > 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?
> 
> Hi 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!

roman



More information about the cfe-dev mailing list