[lkml]   [2015]   [Apr]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] x86: Align jump targets to 1 byte boundaries

* Markus Trippelsdorf <> wrote:

> On 2015.04.10 at 06:18 -0700, H. Peter Anvin wrote:
> > On 04/10/2015 05:50 AM, Denys Vlasenko wrote:
> > >
> > > However, I'm an -Os guy. Expect -O2 people to disagree :)
> > >
> >
> > The problem with -Os is that the compiler will make *any* tradeoffs to
> > save a byte. It is really designed to squeeze as much code into a
> > fixed-size chunk, e.g. a ROM, as possible.
> >
> > We have asked for an -Okernel mode from the gcc folks forever. It
> > basically would mean "-Os except when really dumb."
> If you want the best of both worlds perhaps you should reconsider Andy's
> LTO patch? With -flto gcc automatically optimizes all functions that it
> considers cold for size. So you could expect some code size savings even
> with -O2 (or -O3).

In my (past) experience the main win from -flto is not due to better
hot/cold decisions, but simply due to more aggressive dead code
elimination. -flto has less of an effect on code that is actually
being executed.

Which isn't to be sneered at, but it's far less of a direct effect as
branch probabilities are, which cut to the core of most hotpaths in
the kernel.



 \ /
  Last update: 2015-04-12 12:41    [W:0.114 / U:0.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site