aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vect-loop.c
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2018-07-31 14:25:39 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2018-07-31 14:25:39 +0000
commite4057a3920490abb69bb22237ebe380ac4fd64f5 (patch)
tree213309e3bfefb1678e2bbcfb8b29aa4e7ef52580 /gcc/tree-vect-loop.c
parentd7609678843a0711cf77b5530149658c3997a906 (diff)
downloadgcc-e4057a3920490abb69bb22237ebe380ac4fd64f5.zip
gcc-e4057a3920490abb69bb22237ebe380ac4fd64f5.tar.gz
gcc-e4057a3920490abb69bb22237ebe380ac4fd64f5.tar.bz2
[34/46] Alter interface to vect_get_vec_def_for_stmt_copy
This patch makes vect_get_vec_def_for_stmt_copy take a vec_info rather than a vect_def_type. If the vector operand passed in is defined in the vectorised region, we should look for copies in the normal way. If it's defined in an external statement (such as by vect_init_vector_1) we should just use the original value. 2018-07-31 Richard Sandiford <richard.sandiford@arm.com> gcc/ * tree-vectorizer.h (vect_get_vec_defs_for_stmt_copy) (vect_get_vec_def_for_stmt_copy): Take a vec_info rather than a vect_def_type for the first argument. * tree-vect-stmts.c (vect_get_vec_defs_for_stmt_copy): Likewise. (vect_get_vec_def_for_stmt_copy): Likewise. Return the original operand if it isn't defined by a vectorized statement. (vect_build_gather_load_calls): Remove the mask_dt argument and update calls to vect_get_vec_def_for_stmt_copy. (vectorizable_bswap): Likewise the dt argument. (vectorizable_call): Update calls to vectorizable_bswap and vect_get_vec_def_for_stmt_copy. (vectorizable_simd_clone_call, vectorizable_assignment) (vectorizable_shift, vectorizable_operation, vectorizable_condition) (vectorizable_comparison): Update calls to vect_get_vec_def_for_stmt_copy. (vectorizable_store): Likewise. Remove now-unnecessary calls to vect_is_simple_use. (vect_get_loop_based_defs): Remove dt argument and update call to vect_get_vec_def_for_stmt_copy. (vectorizable_conversion): Update calls to vect_get_loop_based_defs and vect_get_vec_def_for_stmt_copy. (vectorizable_load): Update calls to vect_build_gather_load_calls and vect_get_vec_def_for_stmt_copy. * tree-vect-loop.c (vect_create_epilog_for_reduction) (vectorizable_reduction, vectorizable_live_operation): Update calls to vect_get_vec_def_for_stmt_copy. From-SVN: r263149
Diffstat (limited to 'gcc/tree-vect-loop.c')
-rw-r--r--gcc/tree-vect-loop.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c
index 7fe8442..553916a 100644
--- a/gcc/tree-vect-loop.c
+++ b/gcc/tree-vect-loop.c
@@ -4421,7 +4421,6 @@ vect_create_epilog_for_reduction (vec<tree> vect_defs,
bool nested_in_vect_loop = false;
auto_vec<gimple *> new_phis;
auto_vec<stmt_vec_info> inner_phis;
- enum vect_def_type dt = vect_unknown_def_type;
int j, i;
auto_vec<tree> scalar_results;
unsigned int group_size = 1, k, ratio;
@@ -4528,8 +4527,7 @@ vect_create_epilog_for_reduction (vec<tree> vect_defs,
phi_info = STMT_VINFO_RELATED_STMT (phi_info);
if (nested_in_vect_loop)
vec_init_def
- = vect_get_vec_def_for_stmt_copy (initial_def_dt,
- vec_init_def);
+ = vect_get_vec_def_for_stmt_copy (loop_vinfo, vec_init_def);
}
/* Set the loop-entry arg of the reduction-phi. */
@@ -4556,7 +4554,7 @@ vect_create_epilog_for_reduction (vec<tree> vect_defs,
/* Set the loop-latch arg for the reduction-phi. */
if (j > 0)
- def = vect_get_vec_def_for_stmt_copy (vect_unknown_def_type, def);
+ def = vect_get_vec_def_for_stmt_copy (loop_vinfo, def);
add_phi_arg (phi, def, loop_latch_edge (loop), UNKNOWN_LOCATION);
@@ -4697,7 +4695,7 @@ vect_create_epilog_for_reduction (vec<tree> vect_defs,
new_phis.quick_push (phi);
else
{
- def = vect_get_vec_def_for_stmt_copy (dt, def);
+ def = vect_get_vec_def_for_stmt_copy (loop_vinfo, def);
STMT_VINFO_RELATED_STMT (prev_phi_info) = phi_info;
}
@@ -7111,19 +7109,22 @@ vectorizable_reduction (stmt_vec_info stmt_info, gimple_stmt_iterator *gsi,
vec_oprnds0[0] = gimple_get_lhs (new_stmt_info->stmt);
else
vec_oprnds0[0]
- = vect_get_vec_def_for_stmt_copy (dts[0], vec_oprnds0[0]);
+ = vect_get_vec_def_for_stmt_copy (loop_vinfo,
+ vec_oprnds0[0]);
if (single_defuse_cycle && reduc_index == 1)
vec_oprnds1[0] = gimple_get_lhs (new_stmt_info->stmt);
else
vec_oprnds1[0]
- = vect_get_vec_def_for_stmt_copy (dts[1], vec_oprnds1[0]);
+ = vect_get_vec_def_for_stmt_copy (loop_vinfo,
+ vec_oprnds1[0]);
if (op_type == ternary_op)
{
if (single_defuse_cycle && reduc_index == 2)
vec_oprnds2[0] = gimple_get_lhs (new_stmt_info->stmt);
else
vec_oprnds2[0]
- = vect_get_vec_def_for_stmt_copy (dts[2], vec_oprnds2[0]);
+ = vect_get_vec_def_for_stmt_copy (loop_vinfo,
+ vec_oprnds2[0]);
}
}
}
@@ -7945,8 +7946,7 @@ vectorizable_live_operation (stmt_vec_info stmt_info,
/* For multiple copies, get the last copy. */
for (int i = 1; i < ncopies; ++i)
- vec_lhs = vect_get_vec_def_for_stmt_copy (vect_unknown_def_type,
- vec_lhs);
+ vec_lhs = vect_get_vec_def_for_stmt_copy (loop_vinfo, vec_lhs);
/* Get the last lane in the vector. */
bitstart = int_const_binop (MINUS_EXPR, vec_bitsize, bitsize);