This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [4/6] Optionally pick the cheapest loop_vec_info
- From: Richard Sandiford <richard dot sandiford at arm dot com>
- To: Richard Biener <richard dot guenther at gmail dot com>
- Cc: "gcc-patches\@gcc.gnu.org" <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 06 Nov 2019 14:01:24 +0000
- Subject: Re: [4/6] Optionally pick the cheapest loop_vec_info
- References: <mptbltqtn9b.fsf@arm.com> <mpttv7is8fp.fsf@arm.com> <CAFiYyc3eZvCx1Rw6mg3L=fhk7TEzVrC877diUPUc7Cfof-pHsw@mail.gmail.com>
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.
Thanks,
Richard