Re: [PATCH] trivial: the memset operation on a automatic array variable should be optimized out by data initialization

2007-06-24 Thread Arjan van de Ven
On Sun, 2007-06-24 at 20:12 -0400, Benjamin LaHaise wrote: > On Sun, Jun 24, 2007 at 05:09:16PM -0700, Arjan van de Ven wrote: > > if you care about the last cycle, don't specify -Os but -O2. > > simple as that... you get what you tell the compiler you want. > > Certain distros are shipping kernel

Re: [PATCH] trivial: the memset operation on a automatic array variable should be optimized out by data initialization

2007-06-24 Thread Benjamin LaHaise
On Sun, Jun 24, 2007 at 05:09:16PM -0700, Arjan van de Ven wrote: > if you care about the last cycle, don't specify -Os but -O2. > simple as that... you get what you tell the compiler you want. Certain distros are shipping kernels compiled with -Os. And it's more than just a couple of cycles.

Re: [PATCH] trivial: the memset operation on a automatic array variable should be optimized out by data initialization

2007-06-24 Thread Arjan van de Ven
On Sun, 2007-06-24 at 19:23 -0400, Benjamin LaHaise wrote: > On Sun, Jun 24, 2007 at 03:15:17PM -0700, Arjan van de Ven wrote: > > we should just alias our memset to the __builtin one, and then provide a > > generic one from lib/ for the cases gcc needs to do a fallback. > > The last time I checke

Re: [PATCH] trivial: the memset operation on a automatic array variable should be optimized out by data initialization

2007-06-24 Thread Benjamin LaHaise
On Sun, Jun 24, 2007 at 03:15:17PM -0700, Arjan van de Ven wrote: > we should just alias our memset to the __builtin one, and then provide a > generic one from lib/ for the cases gcc needs to do a fallback. The last time I checked, gcc generated horrible badly performing code for builtin memset/m

memset() with zeroes (Re: [PATCH] trivial: the memset operation on a automatic array variable should be optimized out by data initialization)

2007-06-24 Thread Oleg Verych
On Sun, Jun 24, 2007 at 03:15:17PM -0700, Arjan van de Ven wrote: > > > > I think all these benefits are the gcc's __builtin_memset optimization > > > than the explicit call to memset. > > > > ... or from complex memset() implementation (some chips even didn't do > > `rep' fast enough somehow). M

Re: [PATCH] trivial: the memset operation on a automatic array variable should be optimized out by data initialization

2007-06-24 Thread Arjan van de Ven
> > I think all these benefits are the gcc's __builtin_memset optimization > > than the explicit call to memset. > > ... or from complex memset() implementation (some chips even didn't do > `rep' fast enough somehow). Maybe code like below will be acceptable for > both optimizers and maintainers?

Re: [PATCH] trivial: the memset operation on a automatic array variable should be optimized out by data initialization

2007-06-24 Thread Oleg Verych
On Sun, Jun 24, 2007 at 08:58:10PM +0800, rae l wrote: > On 6/23/07, Oleg Verych <[EMAIL PROTECTED]> wrote: > >Why not just show actual objdump output on code (maybe with different > >oxygen atoms used in gcc), rather than *talking* about optimization and > >standards, hm? > here is the objdump out

Re: [PATCH] trivial: the memset operation on a automatic array variable should be optimized out by data initialization

2007-06-24 Thread rae l
On 6/23/07, Oleg Verych <[EMAIL PROTECTED]> wrote: Why not just show actual objdump output on code (maybe with different oxygen atoms used in gcc), rather than *talking* about optimization and standards, hm? here is the objdump output of the two object files: As you could see, the older one used

Re: [PATCH] trivial: the memset operation on a automatic array variable should be optimized out by data initialization

2007-06-23 Thread Segher Boessenkool
gcc is a C compiler and claims to follow the C standard. Not with the options the kernel build uses. But, close enough -- the differences are really minor stuff. Segher - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] Mor

Re: [PATCH] trivial: the memset operation on a automatic array variable should be optimized out by data initialization

2007-06-23 Thread Adrian Bunk
On Sat, Jun 23, 2007 at 03:41:26PM +0200, Oleg Verych wrote: > On Sat, Jun 23, 2007 at 03:13:55PM +0200, Adrian Bunk wrote: > > On Sat, Jun 23, 2007 at 09:59:33AM +0200, Oleg Verych wrote: > [] > > > > From: Denis Cheng <[EMAIL PROTECTED]> > > > > > > > > the explicit memset call could be optimized

Re: [PATCH] trivial: the memset operation on a automatic array variable should be optimized out by data initialization

2007-06-23 Thread Oleg Verych
On Sat, Jun 23, 2007 at 03:13:55PM +0200, Adrian Bunk wrote: > On Sat, Jun 23, 2007 at 09:59:33AM +0200, Oleg Verych wrote: [] > > > From: Denis Cheng <[EMAIL PROTECTED]> > > > > > > the explicit memset call could be optimized out by data initialization, > > > thus all the fill working can be done

Re: [PATCH] trivial: the memset operation on a automatic array variable should be optimized out by data initialization

2007-06-23 Thread Adrian Bunk
On Sat, Jun 23, 2007 at 09:59:33AM +0200, Oleg Verych wrote: > * From: Denis Cheng > * Newsgroups: linux.kernel > * Date: Fri, 22 Jun 2007 22:15:49 -0700 (PDT) > > > From: Denis Cheng <[EMAIL PROTECTED]> > > > > the explicit memset call could be optimized out by data initialization, > > thus all

Re: [PATCH] trivial: the memset operation on a automatic array variable should be optimized out by data initialization

2007-06-23 Thread Oleg Verych
* From: Denis Cheng * Newsgroups: linux.kernel * Date: Fri, 22 Jun 2007 22:15:49 -0700 (PDT) > From: Denis Cheng <[EMAIL PROTECTED]> > > the explicit memset call could be optimized out by data initialization, > thus all the fill working can be done by the compiler implicitly. Can be optimized an

[PATCH] trivial: the memset operation on a automatic array variable should be optimized out by data initialization

2007-06-22 Thread Denis Cheng
From: Denis Cheng <[EMAIL PROTECTED]> the explicit memset call could be optimized out by data initialization, thus all the fill working can be done by the compiler implicitly. and C standard guaranteed all the unspecified data field initialized to zero. Signed-off-by: Denis Cheng <[EMAIL PROTECT

Re: [PATCH] trivial: the memset operation on a automatic array variable should be optimized out by data initialization

2007-06-21 Thread rae l
On 6/19/07, Jeremy Fitzhardinge <[EMAIL PROTECTED]> wrote: Denis Cheng wrote: > From: Denis Cheng <[EMAIL PROTECTED]> > > the explicit memset call could be optimized out by data initialization, > thus all the fill working can be done by the compiler implicitly. > How does the generated code chan

Re: [PATCH] trivial: the memset operation on a automatic array variable should be optimized out by data initialization

2007-06-19 Thread Adrian Bunk
On Mon, Jun 18, 2007 at 10:07:21AM -0700, Jeremy Fitzhardinge wrote: > Denis Cheng wrote: > > From: Denis Cheng <[EMAIL PROTECTED]> > > > > the explicit memset call could be optimized out by data initialization, > > thus all the fill working can be done by the compiler implicitly. > > How does the

Re: [PATCH] trivial: the memset operation on a automatic array variable should be optimized out by data initialization

2007-06-18 Thread Jeremy Fitzhardinge
Denis Cheng wrote: > From: Denis Cheng <[EMAIL PROTECTED]> > > the explicit memset call could be optimized out by data initialization, > thus all the fill working can be done by the compiler implicitly. > How does the generated code change? Does gcc do something stupid like statically allocate

Re: [PATCH] trivial: the memset operation on a automatic array variable should be optimized out by data initialization

2007-06-18 Thread WANG Cong
On Mon, Jun 18, 2007 at 06:25:17AM -0400, Robert P. J. Day wrote: >On Mon, 18 Jun 2007, Denis Cheng wrote: > >> From: Denis Cheng <[EMAIL PROTECTED]> >> >> the explicit memset call could be optimized out by data initialization, >> thus all the fill working can be done by the compiler implicitly. >>

Re: [PATCH] trivial: the memset operation on a automatic array variable should be optimized out by data initialization

2007-06-18 Thread Robert P. J. Day
On Mon, 18 Jun 2007, Denis Cheng wrote: > From: Denis Cheng <[EMAIL PROTECTED]> > > the explicit memset call could be optimized out by data initialization, > thus all the fill working can be done by the compiler implicitly. > > Signed-off-by: Denis Cheng <[EMAIL PROTECTED]> > > --- > Is there some

[PATCH] trivial: the memset operation on a automatic array variable should be optimized out by data initialization

2007-06-18 Thread Denis Cheng
From: Denis Cheng <[EMAIL PROTECTED]> the explicit memset call could be optimized out by data initialization, thus all the fill working can be done by the compiler implicitly. Signed-off-by: Denis Cheng <[EMAIL PROTECTED]> --- Is there some comments on this? --- arch/x86_64/mm/init.c.orig 2007