re PR target/80846 (auto-vectorized AVX2 horizontal sum should narrow to 128b right...
authorRichard Biener <rguenther@suse.de>
Fri, 12 Jan 2018 11:43:13 +0000 (11:43 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Fri, 12 Jan 2018 11:43:13 +0000 (11:43 +0000)
commitc803b2a92822c57abf5464deaf5be5c31d8a4692
tree4a8bf4ce632240e45cdadcf69318f73f17a0f232
parent46336a0eab790e4f94dd7e7ecf9339a884c44746
re PR target/80846 (auto-vectorized AVX2 horizontal sum should narrow to 128b right away, to be more efficient for Ryzen and Intel)

2018-01-12  Richard Biener  <rguenther@suse.de>

PR tree-optimization/80846
* target.def (split_reduction): New target hook.
* targhooks.c (default_split_reduction): New function.
* targhooks.h (default_split_reduction): Declare.
* tree-vect-loop.c (vect_create_epilog_for_reduction): If the
target requests first reduce vectors by combining low and high
parts.
* tree-vect-stmts.c (vect_gen_perm_mask_any): Adjust.
(get_vectype_for_scalar_type_and_size): Export.
* tree-vectorizer.h (get_vectype_for_scalar_type_and_size): Declare.

* doc/tm.texi.in (TARGET_VECTORIZE_SPLIT_REDUCTION): Document.
* doc/tm.texi: Regenerate.

i386/
* config/i386/i386.c (ix86_split_reduction): Implement
TARGET_VECTORIZE_SPLIT_REDUCTION.

* gcc.target/i386/pr80846-1.c: New testcase.
* gcc.target/i386/pr80846-2.c: Likewise.

From-SVN: r256576
13 files changed:
gcc/ChangeLog
gcc/config/i386/i386.c
gcc/doc/tm.texi
gcc/doc/tm.texi.in
gcc/target.def
gcc/targhooks.c
gcc/targhooks.h
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr80846-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr80846-2.c [new file with mode: 0644]
gcc/tree-vect-loop.c
gcc/tree-vect-stmts.c
gcc/tree-vectorizer.h