From 477daf831aea18923733772d686eb1ed448d96e7 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Wed, 27 Nov 2019 12:22:02 +0000 Subject: [PATCH] target.def (TARGET_VECTORIZE_BUILTIN_CONVERSION): Remove. 2019-11-27 Richard Biener * target.def (TARGET_VECTORIZE_BUILTIN_CONVERSION): Remove. * targhooks.c (default_builtin_vectorized_conversion): Likewise. * targhooks.h (default_builtin_vectorized_conversion): Likewise. * optabs-tree.c (supportable_convert_operation): Do not call targetm.vectorize.builtin_conversion. Remove unused decl parameter. * optabs-tree.h (supportable_convert_operation): Adjust. * doc/tm.texi.in (TARGET_VECTORIZE_BUILTIN_CONVERSION): Remove. * doc/tm.texi: Regenerate. * tree-ssa-forwprop.c (simplify_vector_constructor): Adjust. * tree-vect-generic.c (expand_vector_conversion): Likewise. * tree-vect-stmts.c (vect_gen_widened_results_half): Remove unused decl parameter and adjust. (vect_create_vectorized_promotion_stmts): Likewise. (vectorizable_conversion): Adjust. From-SVN: r278765 --- gcc/ChangeLog | 17 ++++++ gcc/doc/tm.texi | 12 ----- gcc/doc/tm.texi.in | 2 - gcc/optabs-tree.c | 19 ++----- gcc/optabs-tree.h | 2 +- gcc/target.def | 16 ------ gcc/targhooks.c | 10 ---- gcc/targhooks.h | 2 - gcc/tree-ssa-forwprop.c | 9 ++-- gcc/tree-vect-generic.c | 16 ++---- gcc/tree-vect-stmts.c | 115 +++++++++++----------------------------- 11 files changed, 58 insertions(+), 162 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b0385da7c8f..e15d2e598c8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,20 @@ +2019-11-27 Richard Biener + + * target.def (TARGET_VECTORIZE_BUILTIN_CONVERSION): Remove. + * targhooks.c (default_builtin_vectorized_conversion): Likewise. + * targhooks.h (default_builtin_vectorized_conversion): Likewise. + * optabs-tree.c (supportable_convert_operation): Do not call + targetm.vectorize.builtin_conversion. Remove unused decl parameter. + * optabs-tree.h (supportable_convert_operation): Adjust. + * doc/tm.texi.in (TARGET_VECTORIZE_BUILTIN_CONVERSION): Remove. + * doc/tm.texi: Regenerate. + * tree-ssa-forwprop.c (simplify_vector_constructor): Adjust. + * tree-vect-generic.c (expand_vector_conversion): Likewise. + * tree-vect-stmts.c (vect_gen_widened_results_half): Remove + unused decl parameter and adjust. + (vect_create_vectorized_promotion_stmts): Likewise. + (vectorizable_conversion): Adjust. + 2019-11-27 Richard Biener PR tree-optimization/92690 diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi index 2244df4dc5b..7116450f532 100644 --- a/gcc/doc/tm.texi +++ b/gcc/doc/tm.texi @@ -5959,18 +5959,6 @@ instruction pattern. There is no need for the hook to handle these two implementation approaches itself. @end deftypefn -@deftypefn {Target Hook} tree TARGET_VECTORIZE_BUILTIN_CONVERSION (unsigned @var{code}, tree @var{dest_type}, tree @var{src_type}) -This hook should return the DECL of a function that implements conversion of the -input vector of type @var{src_type} to type @var{dest_type}. -The value of @var{code} is one of the enumerators in @code{enum tree_code} and -specifies how the conversion is to be applied -(truncation, rounding, etc.). - -If this hook is defined, the autovectorizer will use the -@code{TARGET_VECTORIZE_BUILTIN_CONVERSION} target hook when vectorizing -conversion. Otherwise, it will return @code{NULL_TREE}. -@end deftypefn - @deftypefn {Target Hook} tree TARGET_VECTORIZE_BUILTIN_VECTORIZED_FUNCTION (unsigned @var{code}, tree @var{vec_type_out}, tree @var{vec_type_in}) This hook should return the decl of a function that implements the vectorized variant of the function with the @code{combined_fn} code diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in index 52cd603dc4e..403468682bf 100644 --- a/gcc/doc/tm.texi.in +++ b/gcc/doc/tm.texi.in @@ -4163,8 +4163,6 @@ address; but often a machine-dependent strategy can generate better code. @hook TARGET_VECTORIZE_VEC_PERM_CONST -@hook TARGET_VECTORIZE_BUILTIN_CONVERSION - @hook TARGET_VECTORIZE_BUILTIN_VECTORIZED_FUNCTION @hook TARGET_VECTORIZE_BUILTIN_MD_VECTORIZED_FUNCTION diff --git a/gcc/optabs-tree.c b/gcc/optabs-tree.c index 97cc59255e0..a04e4ffd05c 100644 --- a/gcc/optabs-tree.c +++ b/gcc/optabs-tree.c @@ -270,20 +270,16 @@ optab_for_tree_code (enum tree_code code, const_tree type, Convert operations we currently support directly are FIX_TRUNC and FLOAT. This function checks if these operations are supported - by the target platform either directly (via vector tree-codes), or via - target builtins. + by the target platform directly (via vector tree-codes). Output: - CODE1 is code of vector operation to be used when - vectorizing the operation, if available. - - DECL is decl of target builtin functions to be used - when vectorizing the operation, if available. In this case, - CODE1 is CALL_EXPR. */ + vectorizing the operation, if available. */ bool supportable_convert_operation (enum tree_code code, tree vectype_out, tree vectype_in, - tree *decl, enum tree_code *code1) + enum tree_code *code1) { machine_mode m1,m2; bool truncp; @@ -317,15 +313,6 @@ supportable_convert_operation (enum tree_code code, return true; } - /* Now check for builtin. */ - if (targetm.vectorize.builtin_conversion - && targetm.vectorize.builtin_conversion (code, vectype_out, vectype_in)) - { - *code1 = CALL_EXPR; - *decl = targetm.vectorize.builtin_conversion (code, vectype_out, - vectype_in); - return true; - } return false; } diff --git a/gcc/optabs-tree.h b/gcc/optabs-tree.h index 5e4848997de..dac35014234 100644 --- a/gcc/optabs-tree.h +++ b/gcc/optabs-tree.h @@ -36,7 +36,7 @@ enum optab_subtype the second argument. The third argument distinguishes between the types of vector shifts and rotates. */ optab optab_for_tree_code (enum tree_code, const_tree, enum optab_subtype); -bool supportable_convert_operation (enum tree_code, tree, tree, tree *, +bool supportable_convert_operation (enum tree_code, tree, tree, enum tree_code *); bool expand_vec_cmp_expr_p (tree, tree, enum tree_code); bool expand_vec_cond_expr_p (tree, tree, enum tree_code); diff --git a/gcc/target.def b/gcc/target.def index e705c5d14d9..cce71cd5b20 100644 --- a/gcc/target.def +++ b/gcc/target.def @@ -1797,22 +1797,6 @@ return type of the vectorized function shall be of vector type\n\ tree, (tree fndecl, tree vec_type_out, tree vec_type_in), default_builtin_md_vectorized_function) -/* Returns a function declaration for a builtin that realizes the - vector conversion, or NULL_TREE if not available. */ -DEFHOOK -(builtin_conversion, - "This hook should return the DECL of a function that implements conversion of the\n\ -input vector of type @var{src_type} to type @var{dest_type}.\n\ -The value of @var{code} is one of the enumerators in @code{enum tree_code} and\n\ -specifies how the conversion is to be applied\n\ -(truncation, rounding, etc.).\n\ -\n\ -If this hook is defined, the autovectorizer will use the\n\ -@code{TARGET_VECTORIZE_BUILTIN_CONVERSION} target hook when vectorizing\n\ -conversion. Otherwise, it will return @code{NULL_TREE}.", - tree, (unsigned code, tree dest_type, tree src_type), - default_builtin_vectorized_conversion) - /* Cost of different vector/scalar statements in vectorization cost model. In case of misaligned vector loads and stores the cost depends on the data type and misalignment value. */ diff --git a/gcc/targhooks.c b/gcc/targhooks.c index fd8e43565c3..2d3bcbf3e89 100644 --- a/gcc/targhooks.c +++ b/gcc/targhooks.c @@ -688,16 +688,6 @@ default_builtin_md_vectorized_function (tree, tree, tree) return NULL_TREE; } -/* Vectorized conversion. */ - -tree -default_builtin_vectorized_conversion (unsigned int code ATTRIBUTE_UNUSED, - tree dest_type ATTRIBUTE_UNUSED, - tree src_type ATTRIBUTE_UNUSED) -{ - return NULL_TREE; -} - /* Default vectorizer cost model values. */ int diff --git a/gcc/targhooks.h b/gcc/targhooks.h index e041291347b..34987bbcdb3 100644 --- a/gcc/targhooks.h +++ b/gcc/targhooks.h @@ -93,8 +93,6 @@ extern const char * default_invalid_within_doloop (const rtx_insn *); extern tree default_builtin_vectorized_function (unsigned int, tree, tree); extern tree default_builtin_md_vectorized_function (tree, tree, tree); -extern tree default_builtin_vectorized_conversion (unsigned int, tree, tree); - extern int default_builtin_vectorization_cost (enum vect_cost_for_stmt, tree, int); extern tree default_builtin_reciprocal (tree); diff --git a/gcc/tree-ssa-forwprop.c b/gcc/tree-ssa-forwprop.c index e1bdb49e91c..f95b05b2832 100644 --- a/gcc/tree-ssa-forwprop.c +++ b/gcc/tree-ssa-forwprop.c @@ -2150,11 +2150,9 @@ simplify_vector_constructor (gimple_stmt_iterator *gsi) ? build_vector_type (TREE_TYPE (TREE_TYPE (orig[0])), nelts) : type) : TREE_TYPE (orig[0])); - tree tem; if (conv_code != ERROR_MARK - && (!supportable_convert_operation (conv_code, type, conv_src_type, - &tem, &conv_code) - || conv_code == CALL_EXPR)) + && !supportable_convert_operation (conv_code, type, conv_src_type, + &conv_code)) return false; if (nelts != refnelts) { @@ -2179,10 +2177,9 @@ simplify_vector_constructor (gimple_stmt_iterator *gsi) conv_src_type = (nelts == refnelts ? perm_type : build_vector_type (TREE_TYPE (perm_type), nelts)); - tree tem; if (conv_code != ERROR_MARK && (!supportable_convert_operation (conv_code, type, conv_src_type, - &tem, &conv_code) + &conv_code) || conv_code == CALL_EXPR)) return false; diff --git a/gcc/tree-vect-generic.c b/gcc/tree-vect-generic.c index 091226533e7..7ec6b5fc51e 100644 --- a/gcc/tree-vect-generic.c +++ b/gcc/tree-vect-generic.c @@ -1697,7 +1697,6 @@ expand_vector_conversion (gimple_stmt_iterator *gsi) gimple *g; tree lhs = gimple_call_lhs (stmt); tree arg = gimple_call_arg (stmt, 0); - tree decl = NULL_TREE; tree ret_type = TREE_TYPE (lhs); tree arg_type = TREE_TYPE (arg); tree new_rhs, compute_type = TREE_TYPE (arg_type); @@ -1724,16 +1723,9 @@ expand_vector_conversion (gimple_stmt_iterator *gsi) if (modifier == NONE && (code == FIX_TRUNC_EXPR || code == FLOAT_EXPR)) { - if (supportable_convert_operation (code, ret_type, arg_type, &decl, - &code1)) + if (supportable_convert_operation (code, ret_type, arg_type, &code1)) { - if (code1 == CALL_EXPR) - { - g = gimple_build_call (decl, 1, arg); - gimple_call_set_lhs (g, lhs); - } - else - g = gimple_build_assign (lhs, code1, arg); + g = gimple_build_assign (lhs, code1, arg); gsi_replace (gsi, g, false); return; } @@ -1752,11 +1744,11 @@ expand_vector_conversion (gimple_stmt_iterator *gsi) tree ret1_type = build_vector_type (TREE_TYPE (ret_type), nelts); tree arg1_type = build_vector_type (TREE_TYPE (arg_type), nelts); if (supportable_convert_operation (code, ret1_type, arg1_type, - &decl, &code1)) + &code1)) { new_rhs = expand_vector_piecewise (gsi, do_vec_conversion, ret_type, arg1_type, arg, - decl, code1); + NULL_TREE, code1); g = gimple_build_assign (lhs, new_rhs); gsi_replace (gsi, g, false); return; diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c index f555fccde8e..426ae2c9fae 100644 --- a/gcc/tree-vect-stmts.c +++ b/gcc/tree-vect-stmts.c @@ -4482,7 +4482,6 @@ vectorizable_simd_clone_call (stmt_vec_info stmt_info, static gimple * vect_gen_widened_results_half (enum tree_code code, - tree decl, tree vec_oprnd0, tree vec_oprnd1, int op_type, tree vec_dest, gimple_stmt_iterator *gsi, stmt_vec_info stmt_info) @@ -4491,26 +4490,12 @@ vect_gen_widened_results_half (enum tree_code code, tree new_temp; /* Generate half of the widened result: */ - if (code == CALL_EXPR) - { - /* Target specific support */ - if (op_type == binary_op) - new_stmt = gimple_build_call (decl, 2, vec_oprnd0, vec_oprnd1); - else - new_stmt = gimple_build_call (decl, 1, vec_oprnd0); - new_temp = make_ssa_name (vec_dest, new_stmt); - gimple_call_set_lhs (new_stmt, new_temp); - } - else - { - /* Generic support */ - gcc_assert (op_type == TREE_CODE_LENGTH (code)); - if (op_type != binary_op) - vec_oprnd1 = NULL; - new_stmt = gimple_build_assign (vec_dest, code, vec_oprnd0, vec_oprnd1); - new_temp = make_ssa_name (vec_dest, new_stmt); - gimple_assign_set_lhs (new_stmt, new_temp); - } + gcc_assert (op_type == TREE_CODE_LENGTH (code)); + if (op_type != binary_op) + vec_oprnd1 = NULL; + new_stmt = gimple_build_assign (vec_dest, code, vec_oprnd0, vec_oprnd1); + new_temp = make_ssa_name (vec_dest, new_stmt); + gimple_assign_set_lhs (new_stmt, new_temp); vect_finish_stmt_generation (stmt_info, new_stmt, gsi); return new_stmt; @@ -4636,8 +4621,7 @@ vect_create_vectorized_promotion_stmts (vec *vec_oprnds0, stmt_vec_info stmt_info, tree vec_dest, gimple_stmt_iterator *gsi, enum tree_code code1, - enum tree_code code2, tree decl1, - tree decl2, int op_type) + enum tree_code code2, int op_type) { int i; tree vop0, vop1, new_tmp1, new_tmp2; @@ -4653,10 +4637,10 @@ vect_create_vectorized_promotion_stmts (vec *vec_oprnds0, vop1 = NULL_TREE; /* Generate the two halves of promotion operation. */ - new_stmt1 = vect_gen_widened_results_half (code1, decl1, vop0, vop1, + new_stmt1 = vect_gen_widened_results_half (code1, vop0, vop1, op_type, vec_dest, gsi, stmt_info); - new_stmt2 = vect_gen_widened_results_half (code2, decl2, vop0, vop1, + new_stmt2 = vect_gen_widened_results_half (code2, vop0, vop1, op_type, vec_dest, gsi, stmt_info); if (is_gimple_call (new_stmt1)) @@ -4697,7 +4681,6 @@ vectorizable_conversion (stmt_vec_info stmt_info, gimple_stmt_iterator *gsi, loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_info); enum tree_code code, code1 = ERROR_MARK, code2 = ERROR_MARK; enum tree_code codecvt1 = ERROR_MARK, codecvt2 = ERROR_MARK; - tree decl1 = NULL_TREE, decl2 = NULL_TREE; tree new_temp; enum vect_def_type dt[2] = {vect_unknown_def_type, vect_unknown_def_type}; int ndts = 2; @@ -4868,8 +4851,7 @@ vectorizable_conversion (stmt_vec_info stmt_info, gimple_stmt_iterator *gsi, && code != FLOAT_EXPR && !CONVERT_EXPR_CODE_P (code)) return false; - if (supportable_convert_operation (code, vectype_out, vectype_in, - &decl1, &code1)) + if (supportable_convert_operation (code, vectype_out, vectype_in, &code1)) break; /* FALLTHRU */ unsupported: @@ -4909,7 +4891,7 @@ vectorizable_conversion (stmt_vec_info stmt_info, gimple_stmt_iterator *gsi, if (GET_MODE_SIZE (rhs_mode) == fltsz) { if (!supportable_convert_operation (code, vectype_out, - cvt_type, &decl1, &codecvt1)) + cvt_type, &codecvt1)) goto unsupported; } else if (!supportable_widening_operation (code, stmt_info, @@ -4960,7 +4942,7 @@ vectorizable_conversion (stmt_vec_info stmt_info, gimple_stmt_iterator *gsi, if (cvt_type == NULL_TREE) goto unsupported; if (!supportable_convert_operation (code, cvt_type, vectype_in, - &decl1, &codecvt1)) + &codecvt1)) goto unsupported; if (supportable_narrowing_operation (NOP_EXPR, vectype_out, cvt_type, &code1, &multi_step_cvt, @@ -5079,24 +5061,12 @@ vectorizable_conversion (stmt_vec_info stmt_info, gimple_stmt_iterator *gsi, { stmt_vec_info new_stmt_info; /* Arguments are ready, create the new vector stmt. */ - if (code1 == CALL_EXPR) - { - gcall *new_stmt = gimple_build_call (decl1, 1, vop0); - new_temp = make_ssa_name (vec_dest, new_stmt); - gimple_call_set_lhs (new_stmt, new_temp); - new_stmt_info - = vect_finish_stmt_generation (stmt_info, new_stmt, gsi); - } - else - { - gcc_assert (TREE_CODE_LENGTH (code1) == unary_op); - gassign *new_stmt - = gimple_build_assign (vec_dest, code1, vop0); - new_temp = make_ssa_name (vec_dest, new_stmt); - gimple_assign_set_lhs (new_stmt, new_temp); - new_stmt_info - = vect_finish_stmt_generation (stmt_info, new_stmt, gsi); - } + gcc_assert (TREE_CODE_LENGTH (code1) == unary_op); + gassign *new_stmt = gimple_build_assign (vec_dest, code1, vop0); + new_temp = make_ssa_name (vec_dest, new_stmt); + gimple_assign_set_lhs (new_stmt, new_temp); + new_stmt_info + = vect_finish_stmt_generation (stmt_info, new_stmt, gsi); if (slp_node) SLP_TREE_VEC_STMTS (slp_node).quick_push (new_stmt_info); @@ -5188,8 +5158,7 @@ vectorizable_conversion (stmt_vec_info stmt_info, gimple_stmt_iterator *gsi, vect_create_vectorized_promotion_stmts (&vec_oprnds0, &vec_oprnds1, stmt_info, this_dest, gsi, - c1, c2, decl1, decl2, - op_type); + c1, c2, op_type); } FOR_EACH_VEC_ELT (vec_oprnds0, i, vop0) @@ -5197,25 +5166,12 @@ vectorizable_conversion (stmt_vec_info stmt_info, gimple_stmt_iterator *gsi, stmt_vec_info new_stmt_info; if (cvt_type) { - if (codecvt1 == CALL_EXPR) - { - gcall *new_stmt = gimple_build_call (decl1, 1, vop0); - new_temp = make_ssa_name (vec_dest, new_stmt); - gimple_call_set_lhs (new_stmt, new_temp); - new_stmt_info - = vect_finish_stmt_generation (stmt_info, new_stmt, - gsi); - } - else - { - gcc_assert (TREE_CODE_LENGTH (codecvt1) == unary_op); - new_temp = make_ssa_name (vec_dest); - gassign *new_stmt - = gimple_build_assign (new_temp, codecvt1, vop0); - new_stmt_info - = vect_finish_stmt_generation (stmt_info, new_stmt, - gsi); - } + gcc_assert (TREE_CODE_LENGTH (codecvt1) == unary_op); + new_temp = make_ssa_name (vec_dest); + gassign *new_stmt + = gimple_build_assign (new_temp, codecvt1, vop0); + new_stmt_info + = vect_finish_stmt_generation (stmt_info, new_stmt, gsi); } else new_stmt_info = vinfo->lookup_def (vop0); @@ -5258,22 +5214,11 @@ vectorizable_conversion (stmt_vec_info stmt_info, gimple_stmt_iterator *gsi, if (cvt_type) FOR_EACH_VEC_ELT (vec_oprnds0, i, vop0) { - if (codecvt1 == CALL_EXPR) - { - gcall *new_stmt = gimple_build_call (decl1, 1, vop0); - new_temp = make_ssa_name (vec_dest, new_stmt); - gimple_call_set_lhs (new_stmt, new_temp); - vect_finish_stmt_generation (stmt_info, new_stmt, gsi); - } - else - { - gcc_assert (TREE_CODE_LENGTH (codecvt1) == unary_op); - new_temp = make_ssa_name (vec_dest); - gassign *new_stmt - = gimple_build_assign (new_temp, codecvt1, vop0); - vect_finish_stmt_generation (stmt_info, new_stmt, gsi); - } - + gcc_assert (TREE_CODE_LENGTH (codecvt1) == unary_op); + new_temp = make_ssa_name (vec_dest); + gassign *new_stmt + = gimple_build_assign (new_temp, codecvt1, vop0); + vect_finish_stmt_generation (stmt_info, new_stmt, gsi); vec_oprnds0[i] = new_temp; } -- 2.30.2