This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][2/2] PR60510, reduction chain vectorization w/o SLP
- From: Szabolcs Nagy <szabolcs dot nagy at arm dot com>
- To: Richard Biener <rguenther at suse dot de>, gcc-patches at gcc dot gnu dot org
- Cc: nd at arm dot com
- Date: Fri, 07 Jul 2017 17:48:46 +0100
- Subject: Re: [PATCH][2/2] PR60510, reduction chain vectorization w/o SLP
- Authentication-results: sourceware.org; auth=none
- Authentication-results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=arm.com;
- Nodisclaimer: True
- References: <alpine.LSU.2.20.1707031538060.23185@zhemvz.fhfr.qr>
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
On 03/07/17 14:42, Richard Biener wrote:
>
> The following is the patch enabling non-SLP vectorization of failed SLP
> reduction chains. It simply dissolves the group composing the SLP
> reduction chain when vect_analyze_slp fails to detect the SLP and then
> fixes up the remaining pieces in reduction vectorization.
>
> I've made sure that SPEC CPU 2006 is clean on x86_64 (-Ofast
> -march=haswell, test run only) and gathered some statistics and
> -fopt-info-vec shows 2220 more vectorized loops (from a now total
> of 13483) which is a nice improvement of 15%.
>
> Bootstrapped and tested on x86_64-unknown-linux-gnu, applied to trunk.
>
> One day left to fix fallout before I leave for vacation.
>
> Richard.
>
> 2017-07-03 Richard Biener <rguenther@suse.de>
>
> PR tree-optimization/60510
> * tree-vect-loop.c (vect_create_epilog_for_reduction): Pass in
> the scalar reduction PHI and use it.
> (vectorizable_reduction): Properly guard the single_defuse_cycle
> path for non-SLP reduction chains where we cannot use it.
> Rework reduc_def/index and vector type deduction. Rework
> vector operand gathering during reduction op code-gen.
> * tree-vect-slp.c (vect_analyze_slp): For failed SLP reduction
> chains dissolve the chain and leave it to non-SLP reduction
> handling.
>
> * gfortran.dg/vect/pr60510.f: New testcase.
>
i saw
FAIL: gfortran.dg/vect/pr60510.f -O0 scan-tree-dump vect "reduction chain"
FAIL: gfortran.dg/vect/pr60510.f -O0 scan-tree-dump-times vect "vectorized 1 loops" 2
...
on arm-none-linux-gnueabihf
committed the patch below as obvious:
Index: gcc/testsuite/gfortran.dg/vect/pr60510.f
===================================================================
--- gcc/testsuite/gfortran.dg/vect/pr60510.f (revision 250052)
+++ gcc/testsuite/gfortran.dg/vect/pr60510.f (working copy)
@@ -1,4 +1,5 @@
! { dg-do run }
+! { dg-require-effective-target vect_double }
! { dg-additional-options "-fno-inline -ffast-math" }
subroutine foo(a,x,y,n)
implicit none