Handle more SLP constant and extern definitions for variable VF

Programming / Compilers / GCC - rsandifo [138bc75d-0d04-0410-961f-82ee72b054a4] - 13 January 2018 17:58 EST

This patch adds support for vectorising SLP definitions that are constant or external (i.e. from outside the loop) when the vectorisation factor isn't known at compile time. It can only handle cases where the number of SLP statements is a power of 2.

2018-01-13 Richard Sandiford Alan Hayward David Sherwood

gcc/
- tree-vect-slp.c: Include gimple-fold.h and internal-fn.h (can_duplicate_and_interleave_p): New function. (vect_get_and_check_slp_defs): Take the vector of statements rather than just the current one. Remove excess parentheses. Restriction rejectinon of vect_constant_def and vect_external_def for variable-length vectors to boolean types, or types for which can_duplicate_and_interleave_p is false. (vect_build_slp_tree_2): Update call to vect_get_and_check_slp_defs. (duplicate_and_interleave): New function. (vect_get_constant_vectors): Use gimple_build_vector for constant-length vectors and suitable variable-length constant
vectors. Use duplicate_and_interleave for other variable-length
vectors. Don't defer the update when inserting new statements.

gcc/testsuite/
- gcc.dg/vect/no-scevccp-slp-30.c: Don't XFAIL for vect_variable_length && vect_load_lanes
- gcc.dg/vect/slp-1.c: Likewise.
- gcc.dg/vect/slp-10.c: Likewise.
- gcc.dg/vect/slp-12b.c: Likewise.
- gcc.dg/vect/slp-12c.c: Likewise.
- gcc.dg/vect/slp-17.c: Likewise.
- gcc.dg/vect/slp-19b.c: Likewise.
- gcc.dg/vect/slp-20.c: Likewise.
- gcc.dg/vect/slp-21.c: Likewise.
- gcc.dg/vect/slp-22.c: Likewise.
- gcc.dg/vect/slp-23.c: Likewise.
- gcc.dg/vect/slp-24-big-array.c: Likewise.
- gcc.dg/vect/slp-24.c: Likewise.
- gcc.dg/vect/slp-28.c: Likewise.
- gcc.dg/vect/slp-39.c: Likewise.
- gcc.dg/vect/slp-6.c: Likewise.
- gcc.dg/vect/slp-7.c: Likewise.
- gcc.dg/vect/slp-cond-1.c: Likewise.
- gcc.dg/vect/slp-cond-2-big-array.c: Likewise.
- gcc.dg/vect/slp-cond-2.c: Likewise.
- gcc.dg/vect/slp-multitypes-1.c: Likewise.
- gcc.dg/vect/slp-multitypes-8.c: Likewise.
- gcc.dg/vect/slp-multitypes-9.c: Likewise.
- gcc.dg/vect/slp-multitypes-10.c: Likewise.
- gcc.dg/vect/slp-multitypes-12.c: Likewise.
- gcc.dg/vect/slp-perm-6.c: Likewise.
- gcc.dg/vect/slp-widen-mult-half.c: Likewise.
- gcc.dg/vect/vect-live-slp-1.c: Likewise.
- gcc.dg/vect/vect-live-slp-2.c: Likewise.
- gcc.dg/vect/pr33953.c: Don't XFAIL for vect_variable_length.
- gcc.dg/vect/slp-12a.c: Likewise.
- gcc.dg/vect/slp-14.c: Likewise.
- gcc.dg/vect/slp-15.c: Likewise.
- gcc.dg/vect/slp-multitypes-2.c: Likewise.
- gcc.dg/vect/slp-multitypes-4.c: Likewise.
- gcc.dg/vect/slp-multitypes-5.c: Likewise.
- gcc.target/aarch64/sve/slp_1.c: New test.
- gcc.target/aarch64/sve/slp_1_run.c: Likewise.
- gcc.target/aarch64/sve/slp_2.c: Likewise.
- gcc.target/aarch64/sve/slp_2_run.c: Likewise.
- gcc.target/aarch64/sve/slp_3.c: Likewise.
- gcc.target/aarch64/sve/slp_3_run.c: Likewise.
- gcc.target/aarch64/sve/slp_4.c: Likewise.
- gcc.target/aarch64/sve/slp_4_run.c: Likewise.

38f812f68bc Handle more SLP constant and extern definitions for variable VF
gcc/ChangeLog | 18 ++
gcc/testsuite/ChangeLog | 50 +++++
gcc/testsuite/gcc.dg/vect/no-scevccp-slp-30.c | 2 +-
gcc/testsuite/gcc.dg/vect/pr33953.c | 2 +-
gcc/testsuite/gcc.dg/vect/slp-1.c | 2 +-
gcc/testsuite/gcc.dg/vect/slp-10.c | 2 +-
gcc/testsuite/gcc.dg/vect/slp-12a.c | 2 +-
gcc/testsuite/gcc.dg/vect/slp-12b.c | 2 +-
gcc/testsuite/gcc.dg/vect/slp-12c.c | 2 +-
gcc/testsuite/gcc.dg/vect/slp-14.c | 2 +-
gcc/testsuite/gcc.dg/vect/slp-15.c | 2 +-
gcc/testsuite/gcc.dg/vect/slp-17.c | 2 +-
gcc/testsuite/gcc.dg/vect/slp-19b.c | 2 +-
gcc/testsuite/gcc.dg/vect/slp-20.c | 2 +-
gcc/testsuite/gcc.dg/vect/slp-21.c | 2 +-
gcc/testsuite/gcc.dg/vect/slp-22.c | 2 +-
gcc/testsuite/gcc.dg/vect/slp-23.c | 2 +-
gcc/testsuite/gcc.dg/vect/slp-24-big-array.c | 2 +-
gcc/testsuite/gcc.dg/vect/slp-24.c | 2 +-
gcc/testsuite/gcc.dg/vect/slp-28.c | 2 +-
gcc/testsuite/gcc.dg/vect/slp-39.c | 2 +-
gcc/testsuite/gcc.dg/vect/slp-6.c | 2 +-
gcc/testsuite/gcc.dg/vect/slp-7.c | 2 +-
gcc/testsuite/gcc.dg/vect/slp-cond-1.c | 2 +-
gcc/testsuite/gcc.dg/vect/slp-cond-2-big-array.c | 2 +-
gcc/testsuite/gcc.dg/vect/slp-cond-2.c | 2 +-
gcc/testsuite/gcc.dg/vect/slp-multitypes-1.c | 2 +-
gcc/testsuite/gcc.dg/vect/slp-multitypes-10.c | 2 +-
gcc/testsuite/gcc.dg/vect/slp-multitypes-12.c | 2 +-
gcc/testsuite/gcc.dg/vect/slp-multitypes-2.c | 2 +-
gcc/testsuite/gcc.dg/vect/slp-multitypes-4.c | 2 +-
gcc/testsuite/gcc.dg/vect/slp-multitypes-5.c | 2 +-
gcc/testsuite/gcc.dg/vect/slp-multitypes-8.c | 2 +-
gcc/testsuite/gcc.dg/vect/slp-multitypes-9.c | 2 +-
gcc/testsuite/gcc.dg/vect/slp-perm-6.c | 2 +-
gcc/testsuite/gcc.dg/vect/slp-widen-mult-half.c | 2 +-
gcc/testsuite/gcc.dg/vect/vect-live-slp-1.c | 2 +-
gcc/testsuite/gcc.dg/vect/vect-live-slp-2.c | 2 +-
gcc/testsuite/gcc.target/aarch64/sve/slp_1.c | 40 ++++
gcc/testsuite/gcc.target/aarch64/sve/slp_1_run.c | 30 +++
gcc/testsuite/gcc.target/aarch64/sve/slp_2.c | 37 ++++
gcc/testsuite/gcc.target/aarch64/sve/slp_2_run.c | 30 +++
gcc/testsuite/gcc.target/aarch64/sve/slp_3.c | 49 +++++
gcc/testsuite/gcc.target/aarch64/sve/slp_3_run.c | 30 +++
gcc/testsuite/gcc.target/aarch64/sve/slp_4.c | 61 ++++++
gcc/testsuite/gcc.target/aarch64/sve/slp_4_run.c | 30 +++
gcc/tree-vect-slp.c | 264 +++++++++++++++++++----
47 files changed, 635 insertions(+), 76 deletions(-)

Upstream: gcc.gnu.org


  • Share