Re: Unnecessary PRE optimization

2009-12-30 Thread Richard Guenther
On Sat, Dec 26, 2009 at 2:07 AM, Daniel Berlin wrote: >> In general it will be tricky for latter passes to clean up the messes. >> The fundamental problem is that the address computation is exposed to >> PRE prematurely (for a given target  ) at GIMPLE level. > > > Yeah, i'm not sure PRE can reall

Re: Unnecessary PRE optimization

2009-12-25 Thread Daniel Berlin
> In general it will be tricky for latter passes to clean up the messes. > The fundamental problem is that the address computation is exposed to > PRE prematurely (for a given target  ) at GIMPLE level. Yeah, i'm not sure PRE can really do anything different here. I also think you would have a ve

Re: Unnecessary PRE optimization

2009-12-23 Thread Xinliang David Li
Similar situation happens in non loop context as well. PRE commoned address computation without knowing the existence of advanced addressing mode, which result in unnecessary address computation instruction.  The forward substitution code makes local heuristics and looks at each use individually --

Re: Unnecessary PRE optimization

2009-12-23 Thread H.J. Lu
On Wed, Dec 23, 2009 at 10:06 AM, Paolo Bonzini wrote: > On 12/23/2009 06:47 PM, H.J. Lu wrote: >> >> On Wed, Dec 23, 2009 at 8:41 AM, Paolo Bonzini  wrote: >>> >>> On 12/23/2009 04:19 PM, Bingfeng Mei wrote: It seems that just commenting out this check in fwprop.c should work. >>> >>> Y

Re: Unnecessary PRE optimization

2009-12-23 Thread Paolo Bonzini
On 12/23/2009 06:47 PM, H.J. Lu wrote: On Wed, Dec 23, 2009 at 8:41 AM, Paolo Bonzini wrote: On 12/23/2009 04:19 PM, Bingfeng Mei wrote: It seems that just commenting out this check in fwprop.c should work. Yes, but it would pessimize x86. Is there a bug open for x86? Can't we make it ta

Re: Unnecessary PRE optimization

2009-12-23 Thread H.J. Lu
On Wed, Dec 23, 2009 at 8:41 AM, Paolo Bonzini wrote: > On 12/23/2009 04:19 PM, Bingfeng Mei wrote: >> >> It seems that just commenting out this check in fwprop.c should work. > > Yes, but it would pessimize x86. > Is there a bug open for x86? Can't we make it target dependent, something like /

Re: Unnecessary PRE optimization

2009-12-23 Thread Paolo Bonzini
On 12/23/2009 04:19 PM, Bingfeng Mei wrote: It seems that just commenting out this check in fwprop.c should work. Yes, but it would pessimize x86. Paolo

Re: Unnecessary PRE optimization

2009-12-23 Thread Ramana Radhakrishnan
On Wed, 2009-12-23 at 16:00 +0100, Paolo Bonzini wrote: > On 12/23/2009 03:27 PM, Bingfeng Mei wrote: > > Do you mean if TARGET_ADDRES_COST (non-x86) is defined properly, > > this should be fixed? Or it requires extra patch? > > No, if TARGET_ADDRESS_COST was fixed for x86 (and of course defined

RE: Unnecessary PRE optimization

2009-12-23 Thread Bingfeng Mei
aolo Bonzini [mailto:paolo.bonz...@gmail.com] On > Behalf Of Paolo Bonzini > Sent: 23 December 2009 15:01 > To: Bingfeng Mei > Cc: Steven Bosscher; gcc@gcc.gnu.org; dber...@dberlin.org > Subject: Re: Unnecessary PRE optimization > > On 12/23/2009 03:27 PM, Bingfeng Mei wrote: > >

Re: Unnecessary PRE optimization

2009-12-23 Thread Paolo Bonzini
On 12/23/2009 03:27 PM, Bingfeng Mei wrote: Do you mean if TARGET_ADDRES_COST (non-x86) is defined properly, this should be fixed? Or it requires extra patch? No, if TARGET_ADDRESS_COST was fixed for x86 (and of course defined properly for your target), we could fix this very easily. Paolo

RE: Unnecessary PRE optimization

2009-12-23 Thread Bingfeng Mei
Steven Bosscher > Cc: Bingfeng Mei; gcc@gcc.gnu.org; dber...@dberlin.org > Subject: Re: Unnecessary PRE optimization > > On 12/23/2009 01:01 PM, Steven Bosscher wrote: > > On Wed, Dec 23, 2009 at 12:49 PM, Bingfeng > Mei wrote: > >> Hello, > >> I encount

Re: Unnecessary PRE optimization

2009-12-23 Thread Paolo Bonzini
On 12/23/2009 03:05 PM, Joern Rennecke wrote: So if this is only useful for a limited set of targets, why isn't it controlled by an option or a target hook so that it is only turned on on the targets where it is deemed to make sense overall? Well, this optimization is basically the opposite of

Re: Unnecessary PRE optimization

2009-12-23 Thread Joern Rennecke
Quoting Paolo Bonzini : On 12/23/2009 01:01 PM, Steven Bosscher wrote: On Wed, Dec 23, 2009 at 12:49 PM, Bingfeng Mei wrote: Hello, I encounter an issue with PRE optimization, which created worse Is this at -O2 or -O3? I think this could be fixed if fwprop propagated addresses into loops;

Re: Unnecessary PRE optimization

2009-12-23 Thread Paolo Bonzini
On 12/23/2009 01:01 PM, Steven Bosscher wrote: On Wed, Dec 23, 2009 at 12:49 PM, Bingfeng Mei wrote: Hello, I encounter an issue with PRE optimization, which created worse Is this at -O2 or -O3? I think this could be fixed if fwprop propagated addresses into loops; it doesn't because it ma

RE: Unnecessary PRE optimization

2009-12-23 Thread Bingfeng Mei
-O2 > -Original Message- > From: Steven Bosscher [mailto:stevenb@gmail.com] > Sent: 23 December 2009 12:01 > To: Bingfeng Mei > Cc: gcc@gcc.gnu.org; dber...@dberlin.org > Subject: Re: Unnecessary PRE optimization > > On Wed, Dec 23, 2009 at 12:49 PM

Re: Unnecessary PRE optimization

2009-12-23 Thread Steven Bosscher
On Wed, Dec 23, 2009 at 12:49 PM, Bingfeng Mei wrote: > Hello, > I encounter an issue with PRE optimization, which created worse Is this at -O2 or -O3? Ciao! Steven