tree-optimization/95897 - fix fold-left SLP reduction insert place
authorRichard Biener <rguenther@suse.de>
Fri, 26 Jun 2020 08:08:58 +0000 (10:08 +0200)
committerRichard Biener <rguenther@suse.de>
Fri, 26 Jun 2020 11:04:21 +0000 (13:04 +0200)
commit5b959c22bc0158faa359a5899bf46e815dc65290
treed82541e9a266920e6b853dd68010261ae7e6a6de
parent87fce92c5c3660a08172a9e29faf54573cedd9ae
tree-optimization/95897 - fix fold-left SLP reduction insert place

This fixes computation of the insertion place for fold-left SLP
reductions where the PHIs do not have vectorized stmts.  The
SLP representation isn't perfect here thus the following.

2020-06-26  Richard Biener  <rguenther@suse.de>

PR tree-optimization/95897
* tree-vectorizer.h (vectorizable_induction): Remove
unused gimple_stmt_iterator * parameter.
* tree-vect-loop.c (vectorizable_induction): Likewise.
(vect_analyze_loop_operations): Adjust.
* tree-vect-stmts.c (vect_analyze_stmt): Likewise.
(vect_transform_stmt): Likewise.
* tree-vect-slp.c (vect_schedule_slp_instance): Adjust
for fold-left reductions, clarify existing reduction case.

* gcc.dg/vect/pr95897.c: New testcase.
gcc/testsuite/gcc.dg/vect/pr95897.c [new file with mode: 0644]
gcc/tree-vect-loop.c
gcc/tree-vect-slp.c
gcc/tree-vect-stmts.c
gcc/tree-vectorizer.h