From 894dd753ca8a4120078324cc6cf0ba01afff9cab Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Sat, 30 Jun 2018 12:46:36 +0000 Subject: [9a/n] PR85694: Reorder vect_is_simple_use arguments As suggested by Richard B., this patch reorders the arguments to vect_is_simple_use so that def_stmt comes last and is optional. Many callers can then drop it, making it more obvious which of the remaining calls would be affected by the next patch. 2018-06-30 Richard Sandiford gcc/ * tree-vectorizer.h (vect_is_simple_use): Move the gimple ** to the end and default to null. * tree-vect-loop.c (vect_create_epilog_for_reduction) (vectorizable_reduction): Update calls accordingly, dropping the gimple ** argument if the passed-back statement isn't needed. * tree-vect-patterns.c (vect_get_internal_def, type_conversion_p) (vect_recog_rotate_pattern): Likewise. (vect_recog_mask_conversion_pattern): Likewise. * tree-vect-slp.c (vect_get_and_check_slp_defs): Likewise. (vect_mask_constant_operand_p): Likewise. * tree-vect-stmts.c (is_simple_and_all_uses_invariant, process_use): (vect_model_simple_cost, vect_get_vec_def_for_operand): Likewise. (get_group_load_store_type, get_load_store_type): Likewise. (vect_check_load_store_mask, vect_check_store_rhs): Likewise. (vectorizable_call, vectorizable_simd_clone_call): Likewise. (vectorizable_conversion, vectorizable_assignment): Likewise. (vectorizable_shift, vectorizable_operation): Likewise. (vectorizable_store, vect_is_simple_cond): Likewise. (vectorizable_condition, vectorizable_comparison): Likewise. (get_same_sized_vectype, vect_get_mask_type_for_stmt): Likewise. (vect_is_simple_use): Rename the def_stmt argument to def_stmt_out and move it to the end. Cope with null def_stmt_outs. From-SVN: r262272 --- gcc/tree-vect-loop.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'gcc/tree-vect-loop.c') diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c index 8741e0b..73a1a8f 100644 --- a/gcc/tree-vect-loop.c +++ b/gcc/tree-vect-loop.c @@ -4572,7 +4572,6 @@ vect_create_epilog_for_reduction (vec vect_defs, gimple *stmt, { /* Get at the scalar def before the loop, that defines the initial value of the reduction variable. */ - gimple *def_stmt; initial_def = PHI_ARG_DEF_FROM_EDGE (reduc_def_stmt, loop_preheader_edge (loop)); /* Optimize: if initial_def is for REDUC_MAX smaller than the base @@ -4587,7 +4586,7 @@ vect_create_epilog_for_reduction (vec vect_defs, gimple *stmt, || (induc_code == MIN_EXPR && tree_int_cst_lt (induc_val, initial_def)))) induc_val = initial_def; - vect_is_simple_use (initial_def, loop_vinfo, &def_stmt, &initial_def_dt); + vect_is_simple_use (initial_def, loop_vinfo, &initial_def_dt); vec_initial_def = get_initial_def_for_reduction (stmt, initial_def, &adjustment_def); vec_initial_defs.create (1); @@ -6396,7 +6395,7 @@ vectorizable_reduction (gimple *stmt, gimple_stmt_iterator *gsi, continue; is_simple_use = vect_is_simple_use (ops[i], loop_vinfo, - &def_stmt, &dts[i], &tem); + &dts[i], &tem, &def_stmt); dt = dts[i]; gcc_assert (is_simple_use); if (dt == vect_reduction_def) @@ -6592,8 +6591,7 @@ vectorizable_reduction (gimple *stmt, gimple_stmt_iterator *gsi, = PHI_ARG_DEF_FROM_EDGE (def_stmt, loop_preheader_edge (loop)); gcc_assert (cond_reduc_val != NULL_TREE); - vect_is_simple_use (cond_initial_val, loop_vinfo, - &def_stmt, &cond_initial_dt); + vect_is_simple_use (cond_initial_val, loop_vinfo, &cond_initial_dt); if (cond_initial_dt == vect_constant_def && types_compatible_p (TREE_TYPE (cond_initial_val), TREE_TYPE (cond_reduc_val))) -- cgit v1.1