This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, rs6000] Fix vec_construct vectorization cost to be somewhat more accurate
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Segher Boessenkool <segher at kernel dot crashing dot org>
- Cc: Bill Schmidt <wschmidt at linux dot vnet dot ibm dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>, David Edelsohn <dje dot gcc at gmail dot com>
- Date: Mon, 18 Jul 2016 14:29:51 +0200
- Subject: Re: [PATCH, rs6000] Fix vec_construct vectorization cost to be somewhat more accurate
- Authentication-results: sourceware.org; auth=none
- References: <1b21afb4-a971-a95d-1084-53948c9c7f4c@linux.vnet.ibm.com> <20160718115657.GA14108@gate.crashing.org>
On Mon, Jul 18, 2016 at 1:56 PM, Segher Boessenkool
<segher@kernel.crashing.org> wrote:
> Hi Bill,
>
> On Fri, Jul 15, 2016 at 08:55:08AM -0500, Bill Schmidt wrote:
>> This patch is a follow-up to Richard's patch of
>> https://gcc.gnu.org/ml/gcc-patches/2016-06/msg00584.html. The cost of a
>> vec_construct (initialization of an N-way vector by N scalars) is too low,
>> which can cause too-aggressive vectorization in particular for N=8 or
>> higher. Richard changed the default cost to N-1, which is generally
>> sensible. For powerpc I am going with a slightly higher cost of N, which
>> will keep us from being less conservative than the previous values when N=2.
>
>> In any case, the purpose of this patch is simply to avoid vectorizing
>> things we shouldn't when we've undercounted the cost of a vec_construct.
>> Bootstrapped and tested on powerpc64le-unknown-linux-gnu with no
>> regressions (hence the vectorization decisions in the test suite have
>> not changed). Is this ok for trunk?
>
> Do you also have a testcase where it does matter? It would be good to
> add that, then. Or is it fixing a regression?
>
> I know nothing about the cost model, so someone else will have to review,
> or I can just say "okay" ;-)
You can maybe look at gcc.dg/vect/slp-4[35].c (and run it with the cost model
enabled).
Richard.
>
> Segher