From 61d3cdbb12e87dd8bfec8ce082c0ac1d5776474c Mon Sep 17 00:00:00 2001 From: Dorit Nuzman Date: Sat, 18 Jun 2005 13:18:52 +0000 Subject: tree.def (REDUC_MAX_EXPR, [...]): New tree-codes. * tree.def (REDUC_MAX_EXPR, REDUC_MIN_EXPR, REDUC_PLUS_EXPR): New tree-codes. * optabs.h (OTI_reduc_smax, OTI_reduc_umax, OTI_reduc_smin, OTI_reduc_umin, OTI_reduc_plus): New optabs for reduction. (reduc_smax_optab, reduc_umax_optab, reduc_smin_optab, reduc_umin_optab, reduc_plus_optab): New optabs for reduction. * expr.c (expand_expr_real_1): Handle new tree-codes. * tree-inline.c (estimate_num_insns_1): Handle new tree-codes. * tree-pretty-print.c (dump_generic_node, op_prio, op_symbol): Handle new tree-codes. * optabs.c (optab_for_tree_code): Handle new tree-codes. (init_optabs): Initialize new optabs. * genopinit.c (optabs): Define handlers for new optabs. * tree-vect-analyze.c (vect_analyze_operations): Fail vectorization in case of a phi that is marked as relevant. Call vectorizable_reduction. (vect_mark_relevant): Phis may be marked as relevant. (vect_mark_stmts_to_be_vectorized): The use corresponding to the reduction variable in a reduction stmt does not mark its defining phi as relevant. Update documentation accordingly. (vect_can_advance_ivs_p): Skip reduction phis. * tree-vect-transform.c (vect_get_vec_def_for_operand): Takes additional argument. Handle reduction. (vect_create_destination_var): Update call to vect_get_new_vect_var. Handle non-vector argument. (get_initial_def_for_reduction): New function. (vect_create_epilog_for_reduction): New function. (vectorizable_reduction): New function. (vect_get_new_vect_var): Handle new vect_var_kind. (vectorizable_assignment, vectorizable_operation, vectorizable_store, vectorizable_condition): Update call to vect_get_new_vect_var. (vect_transform_stmt): Call vectorizable_reduction. (vect_update_ivs_after_vectorizer): Skip reduction phis. (vect_transform_loop): Skip if stmt is both not relevant and not live. * tree-vectorizer.c (reduction_code_for_scalar_code): New function. (vect_is_simple_reduction): Was empty - added implementation. * tree-vectorizer.h (vect_scalar_var): New enum vect_var_kind value. (reduc_vec_info_type): New enum vect_def_type value. * config/rs6000/altivec.md (reduc_smax_v4si, reduc_smax_v4sf, reduc_umax_v4si, reduc_smin_v4si, reduc_umin_v4sf, reduc_smin_v4sf, reduc_plus_v4si, reduc_plus_v4sf): New define_expands. * tree-vect-analyze.c (vect_determine_vectorization_factor): Remove ENABLE_CHECKING around gcc_assert. * tree-vect-transform.c (vect_do_peeling_for_loop_bound, (vect_do_peeling_for_alignment, vect_transform_loop, vect_get_vec_def_for_operand): Likewise. From-SVN: r101155 --- gcc/optabs.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'gcc/optabs.h') diff --git a/gcc/optabs.h b/gcc/optabs.h index 1426e57..2495fed 100644 --- a/gcc/optabs.h +++ b/gcc/optabs.h @@ -231,6 +231,13 @@ enum optab_index /* Conditional add instruction. */ OTI_addcc, + /* Reduction operations on a vector operand. */ + OTI_reduc_smax, + OTI_reduc_umax, + OTI_reduc_smin, + OTI_reduc_umin, + OTI_reduc_plus, + /* Set specified field of vector operand. */ OTI_vec_set, /* Extract specified field of vector operand. */ @@ -347,6 +354,12 @@ extern GTY(()) optab optab_table[OTI_MAX]; #define push_optab (optab_table[OTI_push]) #define addcc_optab (optab_table[OTI_addcc]) +#define reduc_smax_optab (optab_table[OTI_reduc_smax]) +#define reduc_umax_optab (optab_table[OTI_reduc_umax]) +#define reduc_smin_optab (optab_table[OTI_reduc_smin]) +#define reduc_umin_optab (optab_table[OTI_reduc_umin]) +#define reduc_plus_optab (optab_table[OTI_reduc_plus]) + #define vec_set_optab (optab_table[OTI_vec_set]) #define vec_extract_optab (optab_table[OTI_vec_extract]) #define vec_init_optab (optab_table[OTI_vec_init]) -- cgit v1.1