From: Richard Biener <richard.guenther@gmail.com>
To: Richard Sandiford <richard.sandiford@arm.com>
Cc: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Subject: Re: [4/6] Optionally pick the cheapest loop_vec_info
Date: Wed, 06 Nov 2019 14:50:00 -0000 [thread overview]
Message-ID: <CAFiYyc24cDs9qgCPJ4E3OcVFZ7n+T7H7r=gyUbB+02E=+dkCyw@mail.gmail.com> (raw)
In-Reply-To: <mptpni5nlxn.fsf@arm.com>
On Wed, Nov 6, 2019 at 3:01 PM Richard Sandiford
<richard.sandiford@arm.com> wrote:
>
> Richard Biener <richard.guenther@gmail.com> writes:
> > On Tue, Nov 5, 2019 at 3:29 PM Richard Sandiford
> > <Richard.Sandiford@arm.com> wrote:
> >>
> >> This patch adds a mode in which the vectoriser tries each available
> >> base vector mode and picks the one with the lowest cost. For now
> >> the behaviour is behind a default-off --param, but a later patch
> >> enables it by default for SVE.
> >>
> >> The patch keeps the current behaviour of preferring a VF of
> >> loop->simdlen over any larger or smaller VF, regardless of costs
> >> or target preferences.
> >
> > Can you avoid using a --param for this? Instead I'd suggest to
> > amend the vectorize_modes target hook to return some
> > flags like VECT_FIRST_MODE_WINS. We'd eventually want
> > to make the target able to say do-not-vectorize-epiloges-of-MODE
> > (I think we may not want to vectorize SSE vectorized loop
> > epilogues with MMX-with-SSE or GPRs for example). I guess
> > for the latter we'd use a new target hook.
>
> The reason for using a --param was that I wanted a way of turning
> this on and off on the command line, so that users can experiment
> with it if necessary. E.g. enabling the --param could be a viable
> alternative to -mprefix-* in some cases. Disabling it would be
> a way of working around a bad cost model decision without going
> all the way to -fno-vect-cost-model.
>
> These kinds of --params can become useful workarounds until an
> optimisation bug is fixed.
I'm arguing that the default depends on the actual ISAs so there isn't
a one-fits all and given we have OMP SIMD and target cloning for
multiple ISAs this looks like a wrong approach. For sure the
target can use its own switches to override defaults here, or alternatively
we might want to have a #pragma GCC simdlen mimicing OMP behavior
here.
Richard.
>
> Thanks,
> Richard
next prev parent reply other threads:[~2019-11-06 14:50 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-05 14:24 [0/6] " Richard Sandiford
2019-11-05 14:25 ` [1/6] Fix vectorizable_conversion costs Richard Sandiford
2019-11-06 12:01 ` Richard Biener
2019-11-07 15:14 ` Richard Sandiford
2019-11-07 16:13 ` Richard Biener
2019-11-05 14:27 ` [2/6] Don't assign a cost to vectorizable_assignment Richard Sandiford
2019-11-06 12:04 ` Richard Biener
2019-11-06 15:58 ` Richard Sandiford
2019-11-07 9:35 ` Richard Biener
2019-11-07 16:40 ` Richard Sandiford
2019-11-08 11:24 ` Richard Biener
2019-11-05 14:28 ` [3/6] Avoid accounting for non-existent vector loop versioning Richard Sandiford
2019-11-06 12:05 ` Richard Biener
2019-11-05 14:29 ` [4/6] Optionally pick the cheapest loop_vec_info Richard Sandiford
2019-11-06 12:09 ` Richard Biener
2019-11-06 14:01 ` Richard Sandiford
2019-11-06 14:50 ` Richard Biener [this message]
2019-11-07 17:15 ` Richard Sandiford
2019-11-08 11:27 ` Richard Biener
2019-11-08 12:15 ` Richard Sandiford
2019-11-05 14:31 ` [5/6] Account for the cost of generating loop masks Richard Sandiford
2019-11-06 12:16 ` Richard Biener
2019-11-05 14:32 ` [6/6][AArch64] Enable vect-compare-loop-costs by default for SVE Richard Sandiford
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='CAFiYyc24cDs9qgCPJ4E3OcVFZ7n+T7H7r=gyUbB+02E=+dkCyw@mail.gmail.com' \
--to=richard.guenther@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=richard.sandiford@arm.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).