This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: generic retuning part 1 - x86-tune-costs update


> On Thu, Nov 30, 2017 at 10:40 AM, Jan Hubicka <hubicka@ucw.cz> wrote:
> > Hi,
> > this patch makes costs in generic to math better modern chips (core, haswell,
> > buldozer and zen).  The only important change is to drop cost of unaligned loads
> > and stores becuase all modern chips handle it well.  This makes vectorizer to
> > not peel for alignment and saves a lot of code size without sacrifying
> > performance.
> >
> > I have benchmarked it on zen and skylake and it is small but almost consistent
> > win in performance too.  Notable regression is fma3d regressing aprox. 5%
> > on zen.  This is the case of native tuning as well, so I will look into it
> > incrementally.
> >
> > Bootstrapped/regtested x86_64-linux, comitted.
> 
> The question is how we cost such things as store bandwith where IIRC
> an unaligned store counts 'two' entries in the pipelines store buffers.
> Likewise unaligned loads do usually still have a penalty.
> 
> What changed is that when the loads/stores happen to be aligned
> using the unaligned instruction variant doesn't have a penalty.
> 
> So I'm not sure peeling for alignmend isn't a win, it just depends more
> on the number of memory streams involved.

I have benchmarked this quite thoroughly while switching the defaults for Core
and Zen.  Disabling alignment is pretty much consistent for specfp/int for
2000,2006 and 2017 (last is Zen only) and quite consistent one.  I will analyze
fma3d. It did not show with the alignment change alone, so it may be related
to other costs or just bad luck.

For sure, there may be specific loops where alignment wins, but it seems bad idea
to enable it by default just in case it is needed when it makes regression on
SPECfp.  Lets see if we can identify them and be more careful about alignment
decision.

I also checked that disabling alingment prologues is win even for string
operations and there it is disabled for couple releases already. (I think
since initial tuning for core and Buldozer came in)
Honza
> 
> Richard.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]