From: Jan Hubicka <hubicka@ucw.cz>
To: Richard Biener <richard.guenther@gmail.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: generic retuning part 1 - x86-tune-costs update
Date: Thu, 30 Nov 2017 15:09:00 -0000 [thread overview]
Message-ID: <20171130143401.GB2770@kam.mff.cuni.cz> (raw)
In-Reply-To: <CAFiYyc38SX41hPbhkMdqOcM9R_MLf++SZTqW+iXtOFB7udtK1A@mail.gmail.com>
> 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.
next prev parent reply other threads:[~2017-11-30 14:34 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-30 9:54 Jan Hubicka
2017-11-30 11:03 ` Richard Biener
2017-11-30 15:09 ` Jan Hubicka [this message]
2017-11-30 18:20 ` Jan Hubicka
2017-11-30 18:43 ` Richard Biener
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171130143401.GB2770@kam.mff.cuni.cz \
--to=hubicka@ucw.cz \
--cc=gcc-patches@gcc.gnu.org \
--cc=richard.guenther@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).