diff mbox

[2/2] PR60510, reduction chain vectorization w/o SLP

Message ID 595FBB6E.8000903@arm.com
State New
Headers show

Commit Message

Szabolcs Nagy July 7, 2017, 4:48 p.m. UTC
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:
diff mbox

Patch

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