Commit 3ad3b3ac by Richard Sandiford Committed by Richard Sandiford

Only test STMT_VINFO_STRIDED_P for the first statement in a group

get_load_store_type & co were testing STMT_VINFO_STRIDED_P on individual
statements in a group instead of the first.  This has no effect on
its own, but is needed by a later patch.

2018-08-22  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	* tree-vect-stmts.c (get_group_load_store_type)
	(get_load_store_type): Only test STMT_VINFO_STRIDED_P for the
	first statement in a group.

From-SVN: r263771
parent 257d10b5
2018-08-22 Richard Sandiford <richard.sandiford@arm.com>
* tree-vect-stmts.c (get_group_load_store_type)
(get_load_store_type): Only test STMT_VINFO_STRIDED_P for the
first statement in a group.
2018-08-22 Iain Sandoe <iain@sandoe.co.uk> 2018-08-22 Iain Sandoe <iain@sandoe.co.uk>
* config/darwin.h (LINK_COMMAND_SPEC_A): Sync LTO options with * config/darwin.h (LINK_COMMAND_SPEC_A): Sync LTO options with
......
...@@ -2191,14 +2191,14 @@ get_group_load_store_type (stmt_vec_info stmt_info, tree vectype, bool slp, ...@@ -2191,14 +2191,14 @@ get_group_load_store_type (stmt_vec_info stmt_info, tree vectype, bool slp,
/* There can only be a gap at the end of the group if the stride is /* There can only be a gap at the end of the group if the stride is
known at compile time. */ known at compile time. */
gcc_assert (!STMT_VINFO_STRIDED_P (stmt_info) || gap == 0); gcc_assert (!STMT_VINFO_STRIDED_P (first_stmt_info) || gap == 0);
/* Stores can't yet have gaps. */ /* Stores can't yet have gaps. */
gcc_assert (slp || vls_type == VLS_LOAD || gap == 0); gcc_assert (slp || vls_type == VLS_LOAD || gap == 0);
if (slp) if (slp)
{ {
if (STMT_VINFO_STRIDED_P (stmt_info)) if (STMT_VINFO_STRIDED_P (first_stmt_info))
{ {
/* Try to use consecutive accesses of DR_GROUP_SIZE elements, /* Try to use consecutive accesses of DR_GROUP_SIZE elements,
separated by the stride, until we have a complete vector. separated by the stride, until we have a complete vector.
...@@ -2255,7 +2255,7 @@ get_group_load_store_type (stmt_vec_info stmt_info, tree vectype, bool slp, ...@@ -2255,7 +2255,7 @@ get_group_load_store_type (stmt_vec_info stmt_info, tree vectype, bool slp,
/ vect_get_scalar_dr_size (first_dr_info))) / vect_get_scalar_dr_size (first_dr_info)))
would_overrun_p = false; would_overrun_p = false;
if (!STMT_VINFO_STRIDED_P (stmt_info) if (!STMT_VINFO_STRIDED_P (first_stmt_info)
&& (can_overrun_p || !would_overrun_p) && (can_overrun_p || !would_overrun_p)
&& compare_step_with_zero (stmt_info) > 0) && compare_step_with_zero (stmt_info) > 0)
{ {
...@@ -2466,8 +2466,11 @@ get_load_store_type (stmt_vec_info stmt_info, tree vectype, bool slp, ...@@ -2466,8 +2466,11 @@ get_load_store_type (stmt_vec_info stmt_info, tree vectype, bool slp,
/* FIXME: At the moment the cost model seems to underestimate the /* FIXME: At the moment the cost model seems to underestimate the
cost of using elementwise accesses. This check preserves the cost of using elementwise accesses. This check preserves the
traditional behavior until that can be fixed. */ traditional behavior until that can be fixed. */
stmt_vec_info first_stmt_info = DR_GROUP_FIRST_ELEMENT (stmt_info);
if (!first_stmt_info)
first_stmt_info = stmt_info;
if (*memory_access_type == VMAT_ELEMENTWISE if (*memory_access_type == VMAT_ELEMENTWISE
&& !STMT_VINFO_STRIDED_P (stmt_info) && !STMT_VINFO_STRIDED_P (first_stmt_info)
&& !(stmt_info == DR_GROUP_FIRST_ELEMENT (stmt_info) && !(stmt_info == DR_GROUP_FIRST_ELEMENT (stmt_info)
&& !DR_GROUP_NEXT_ELEMENT (stmt_info) && !DR_GROUP_NEXT_ELEMENT (stmt_info)
&& !pow2p_hwi (DR_GROUP_SIZE (stmt_info)))) && !pow2p_hwi (DR_GROUP_SIZE (stmt_info))))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment