The following removes the non-SLP paths from vectorizable_condition. * tree-vect-stmts.cc (vectorizable_condition): Remove non-SLP paths. --- gcc/tree-vect-stmts.cc | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-)
diff --git a/gcc/tree-vect-stmts.cc b/gcc/tree-vect-stmts.cc index 949bee3b453..dee6185106f 100644 --- a/gcc/tree-vect-stmts.cc +++ b/gcc/tree-vect-stmts.cc @@ -11781,8 +11781,6 @@ vectorizable_condition (vec_info *vinfo, = {vect_unknown_def_type, vect_unknown_def_type, vect_unknown_def_type, vect_unknown_def_type}; int ndts = 4; - int ncopies; - int vec_num; enum tree_code code, cond_code, bitop1 = NOP_EXPR, bitop2 = NOP_EXPR; int i; bb_vec_info bb_vinfo = dyn_cast <bb_vec_info> (vinfo); @@ -11829,12 +11827,7 @@ vectorizable_condition (vec_info *vinfo, tree vectype = SLP_TREE_VECTYPE (slp_node); tree vectype1 = NULL_TREE, vectype2 = NULL_TREE; - ncopies = 1; - vec_num = SLP_TREE_NUMBER_OF_VEC_STMTS (slp_node); - - gcc_assert (ncopies >= 1); - if (for_reduction && ncopies > 1) - return false; /* FORNOW */ + int vec_num = SLP_TREE_NUMBER_OF_VEC_STMTS (slp_node); cond_expr = gimple_assign_rhs1 (stmt); gcc_assert (! COMPARISON_CLASS_P (cond_expr)); @@ -12006,11 +11999,11 @@ vectorizable_condition (vec_info *vinfo, vectype, OPTIMIZE_FOR_SPEED)) vect_record_loop_len (loop_vinfo, &LOOP_VINFO_LENS (loop_vinfo), - ncopies * vec_num, vectype, 1); + vec_num, vectype, 1); else vect_record_loop_mask (loop_vinfo, &LOOP_VINFO_MASKS (loop_vinfo), - ncopies * vec_num, vectype, NULL); + vec_num, vectype, NULL); } /* Extra inactive lanes should be safe for vect_nested_cycle. */ else if (STMT_VINFO_DEF_TYPE (reduc_info) != vect_nested_cycle) @@ -12024,7 +12017,7 @@ vectorizable_condition (vec_info *vinfo, } STMT_VINFO_TYPE (stmt_info) = condition_vec_info_type; - vect_model_simple_cost (vinfo, ncopies, dts, ndts, slp_node, + vect_model_simple_cost (vinfo, 1, dts, ndts, slp_node, cost_vec, kind); return true; } @@ -12054,7 +12047,7 @@ vectorizable_condition (vec_info *vinfo, masks = &LOOP_VINFO_MASKS (loop_vinfo); else { - scalar_cond_masked_key cond (cond_expr, ncopies); + scalar_cond_masked_key cond (cond_expr, 1); if (loop_vinfo->scalar_cond_masked_set.contains (cond)) masks = &LOOP_VINFO_MASKS (loop_vinfo); else @@ -12089,13 +12082,13 @@ vectorizable_condition (vec_info *vinfo, /* Handle cond expr. */ if (masked) - vect_get_vec_defs (vinfo, stmt_info, slp_node, ncopies, + vect_get_vec_defs (vinfo, stmt_info, slp_node, 1, cond_expr, comp_vectype, &vec_oprnds0, then_clause, vectype, &vec_oprnds2, reduction_type != EXTRACT_LAST_REDUCTION ? else_clause : NULL, vectype, &vec_oprnds3); else - vect_get_vec_defs (vinfo, stmt_info, slp_node, ncopies, + vect_get_vec_defs (vinfo, stmt_info, slp_node, 1, cond_expr0, comp_vectype, &vec_oprnds0, cond_expr1, comp_vectype, &vec_oprnds1, then_clause, vectype, &vec_oprnds2, @@ -12217,7 +12210,7 @@ vectorizable_condition (vec_info *vinfo, if (lens) { len = vect_get_loop_len (loop_vinfo, gsi, lens, - vec_num * ncopies, vectype, i, 1); + vec_num, vectype, i, 1); signed char biasval = LOOP_VINFO_PARTIAL_LOAD_STORE_BIAS (loop_vinfo); bias = build_int_cst (intQI_type_node, biasval); @@ -12231,7 +12224,7 @@ vectorizable_condition (vec_info *vinfo, if (masks) { tree loop_mask - = vect_get_loop_mask (loop_vinfo, gsi, masks, vec_num * ncopies, + = vect_get_loop_mask (loop_vinfo, gsi, masks, vec_num, vectype, i); tree tmp2 = make_ssa_name (vec_cmp_type); gassign *g -- 2.43.0