aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vect-patterns.c
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2019-10-21 06:40:53 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2019-10-21 06:40:53 +0000
commit7ed54790da87bbb4a134020a9fb8bd1b72fd0acb (patch)
tree599ea179e29440c0399990f310c1fa22469b8fd0 /gcc/tree-vect-patterns.c
parent1bd5196c9b1a0cd7280adadd6d788f81a82ca023 (diff)
downloadgcc-7ed54790da87bbb4a134020a9fb8bd1b72fd0acb.zip
gcc-7ed54790da87bbb4a134020a9fb8bd1b72fd0acb.tar.gz
gcc-7ed54790da87bbb4a134020a9fb8bd1b72fd0acb.tar.bz2
Pass a vec_info to get_vectype_for_scalar_type
2019-10-21 Richard Sandiford <richard.sandiford@arm.com> gcc/ * tree-vectorizer.h (get_vectype_for_scalar_type): Take a vec_info. * tree-vect-stmts.c (get_vectype_for_scalar_type): Likewise. (vect_prologue_cost_for_slp_op): Update call accordingly. (vect_get_vec_def_for_operand, vect_get_gather_scatter_ops) (vect_get_strided_load_store_ops, vectorizable_simd_clone_call) (vect_supportable_shift, vect_is_simple_cond, vectorizable_comparison) (get_mask_type_for_scalar_type): Likewise. (vect_get_vector_types_for_stmt): Likewise. * tree-vect-data-refs.c (vect_analyze_data_refs): Likewise. * tree-vect-loop.c (vect_determine_vectorization_factor): Likewise. (get_initial_def_for_reduction, build_vect_cond_expr): Likewise. * tree-vect-patterns.c (vect_supportable_direct_optab_p): Likewise. (vect_split_statement, vect_convert_input): Likewise. (vect_recog_widen_op_pattern, vect_recog_pow_pattern): Likewise. (vect_recog_over_widening_pattern, vect_recog_mulhs_pattern): Likewise. (vect_recog_average_pattern, vect_recog_cast_forwprop_pattern) (vect_recog_rotate_pattern, vect_recog_vector_vector_shift_pattern) (vect_synth_mult_by_constant, vect_recog_mult_pattern): Likewise. (vect_recog_divmod_pattern, vect_recog_mixed_size_cond_pattern) (check_bool_pattern, adjust_bool_pattern_cast, adjust_bool_pattern) (search_type_for_mask_1, vect_recog_bool_pattern): Likewise. (vect_recog_mask_conversion_pattern): Likewise. (vect_add_conversion_to_pattern): Likewise. (vect_recog_gather_scatter_pattern): Likewise. * tree-vect-slp.c (vect_build_slp_tree_2): Likewise. (vect_analyze_slp_instance, vect_get_constant_vectors): Likewise. From-SVN: r277227
Diffstat (limited to 'gcc/tree-vect-patterns.c')
-rw-r--r--gcc/tree-vect-patterns.c105
1 files changed, 59 insertions, 46 deletions
diff --git a/gcc/tree-vect-patterns.c b/gcc/tree-vect-patterns.c
index 1be4cc0..b497ec9 100644
--- a/gcc/tree-vect-patterns.c
+++ b/gcc/tree-vect-patterns.c
@@ -187,15 +187,15 @@ vect_get_external_def_edge (vec_info *vinfo, tree var)
is nonnull. */
static bool
-vect_supportable_direct_optab_p (vec_info *, tree otype, tree_code code,
+vect_supportable_direct_optab_p (vec_info *vinfo, tree otype, tree_code code,
tree itype, tree *vecotype_out,
tree *vecitype_out = NULL)
{
- tree vecitype = get_vectype_for_scalar_type (itype);
+ tree vecitype = get_vectype_for_scalar_type (vinfo, itype);
if (!vecitype)
return false;
- tree vecotype = get_vectype_for_scalar_type (otype);
+ tree vecotype = get_vectype_for_scalar_type (vinfo, otype);
if (!vecotype)
return false;
@@ -635,6 +635,7 @@ static bool
vect_split_statement (stmt_vec_info stmt2_info, tree new_rhs,
gimple *stmt1, tree vectype)
{
+ vec_info *vinfo = stmt2_info->vinfo;
if (is_pattern_stmt_p (stmt2_info))
{
/* STMT2_INFO is part of a pattern. Get the statement to which
@@ -678,7 +679,7 @@ vect_split_statement (stmt_vec_info stmt2_info, tree new_rhs,
two-statement pattern now. */
gcc_assert (!STMT_VINFO_RELATED_STMT (stmt2_info));
tree lhs_type = TREE_TYPE (gimple_get_lhs (stmt2_info->stmt));
- tree lhs_vectype = get_vectype_for_scalar_type (lhs_type);
+ tree lhs_vectype = get_vectype_for_scalar_type (vinfo, lhs_type);
if (!lhs_vectype)
return false;
@@ -715,6 +716,8 @@ static tree
vect_convert_input (stmt_vec_info stmt_info, tree type,
vect_unpromoted_value *unprom, tree vectype)
{
+ vec_info *vinfo = stmt_info->vinfo;
+
/* Check for a no-op conversion. */
if (types_compatible_p (type, TREE_TYPE (unprom->op)))
return unprom->op;
@@ -752,7 +755,7 @@ vect_convert_input (stmt_vec_info stmt_info, tree type,
unsigned promotion. */
tree midtype = build_nonstandard_integer_type
(TYPE_PRECISION (type), TYPE_UNSIGNED (unprom->type));
- tree vec_midtype = get_vectype_for_scalar_type (midtype);
+ tree vec_midtype = get_vectype_for_scalar_type (vinfo, midtype);
if (vec_midtype)
{
input = vect_recog_temp_ssa_var (midtype, NULL);
@@ -1189,6 +1192,7 @@ vect_recog_widen_op_pattern (stmt_vec_info last_stmt_info, tree *type_out,
tree_code orig_code, tree_code wide_code,
bool shift_p, const char *name)
{
+ vec_info *vinfo = last_stmt_info->vinfo;
gimple *last_stmt = last_stmt_info->stmt;
vect_unpromoted_value unprom[2];
@@ -1208,8 +1212,8 @@ vect_recog_widen_op_pattern (stmt_vec_info last_stmt_info, tree *type_out,
TYPE_UNSIGNED (half_type));
/* Check target support */
- tree vectype = get_vectype_for_scalar_type (half_type);
- tree vecitype = get_vectype_for_scalar_type (itype);
+ tree vectype = get_vectype_for_scalar_type (vinfo, half_type);
+ tree vecitype = get_vectype_for_scalar_type (vinfo, itype);
enum tree_code dummy_code;
int dummy_int;
auto_vec<tree> dummy_vec;
@@ -1221,7 +1225,7 @@ vect_recog_widen_op_pattern (stmt_vec_info last_stmt_info, tree *type_out,
&dummy_int, &dummy_vec))
return NULL;
- *type_out = get_vectype_for_scalar_type (type);
+ *type_out = get_vectype_for_scalar_type (vinfo, type);
if (!*type_out)
return NULL;
@@ -1342,7 +1346,7 @@ vect_recog_pow_pattern (stmt_vec_info stmt_vinfo, tree *type_out)
if (node->simd_clones == NULL)
return NULL;
}
- *type_out = get_vectype_for_scalar_type (TREE_TYPE (base));
+ *type_out = get_vectype_for_scalar_type (vinfo, TREE_TYPE (base));
if (!*type_out)
return NULL;
tree def = vect_recog_temp_ssa_var (TREE_TYPE (base), NULL);
@@ -1380,7 +1384,7 @@ vect_recog_pow_pattern (stmt_vec_info stmt_vinfo, tree *type_out)
if (TREE_CODE (exp) == REAL_CST
&& real_equal (&TREE_REAL_CST (exp), &dconsthalf))
{
- *type_out = get_vectype_for_scalar_type (TREE_TYPE (base));
+ *type_out = get_vectype_for_scalar_type (vinfo, TREE_TYPE (base));
if (*type_out
&& direct_internal_fn_supported_p (IFN_SQRT, *type_out,
OPTIMIZE_FOR_SPEED))
@@ -1665,7 +1669,7 @@ vect_recog_over_widening_pattern (stmt_vec_info last_stmt_info, tree *type_out)
vect_pattern_detected ("vect_recog_over_widening_pattern", last_stmt);
- *type_out = get_vectype_for_scalar_type (type);
+ *type_out = get_vectype_for_scalar_type (vinfo, type);
if (!*type_out)
return NULL;
@@ -1686,8 +1690,8 @@ vect_recog_over_widening_pattern (stmt_vec_info last_stmt_info, tree *type_out)
wants to rewrite anyway. If targets have a minimum element size
for some optabs, we should pattern-match smaller ops to larger ops
where beneficial. */
- tree new_vectype = get_vectype_for_scalar_type (new_type);
- tree op_vectype = get_vectype_for_scalar_type (op_type);
+ tree new_vectype = get_vectype_for_scalar_type (vinfo, new_type);
+ tree op_vectype = get_vectype_for_scalar_type (vinfo, op_type);
if (!new_vectype || !op_vectype)
return NULL;
@@ -1864,7 +1868,7 @@ vect_recog_mulhs_pattern (stmt_vec_info last_stmt_info, tree *type_out)
(target_precision, TYPE_UNSIGNED (new_type));
/* Check for target support. */
- tree new_vectype = get_vectype_for_scalar_type (new_type);
+ tree new_vectype = get_vectype_for_scalar_type (vinfo, new_type);
if (!new_vectype
|| !direct_internal_fn_supported_p
(ifn, new_vectype, OPTIMIZE_FOR_SPEED))
@@ -1872,7 +1876,7 @@ vect_recog_mulhs_pattern (stmt_vec_info last_stmt_info, tree *type_out)
/* The IR requires a valid vector type for the cast result, even though
it's likely to be discarded. */
- *type_out = get_vectype_for_scalar_type (lhs_type);
+ *type_out = get_vectype_for_scalar_type (vinfo, lhs_type);
if (!*type_out)
return NULL;
@@ -2014,7 +2018,7 @@ vect_recog_average_pattern (stmt_vec_info last_stmt_info, tree *type_out)
TYPE_UNSIGNED (new_type));
/* Check for target support. */
- tree new_vectype = get_vectype_for_scalar_type (new_type);
+ tree new_vectype = get_vectype_for_scalar_type (vinfo, new_type);
if (!new_vectype
|| !direct_internal_fn_supported_p (ifn, new_vectype,
OPTIMIZE_FOR_SPEED))
@@ -2022,7 +2026,7 @@ vect_recog_average_pattern (stmt_vec_info last_stmt_info, tree *type_out)
/* The IR requires a valid vector type for the cast result, even though
it's likely to be discarded. */
- *type_out = get_vectype_for_scalar_type (type);
+ *type_out = get_vectype_for_scalar_type (vinfo, type);
if (!*type_out)
return NULL;
@@ -2108,7 +2112,7 @@ vect_recog_cast_forwprop_pattern (stmt_vec_info last_stmt_info, tree *type_out)
the unnecessary widening and narrowing. */
vect_pattern_detected ("vect_recog_cast_forwprop_pattern", last_stmt);
- *type_out = get_vectype_for_scalar_type (lhs_type);
+ *type_out = get_vectype_for_scalar_type (vinfo, lhs_type);
if (!*type_out)
return NULL;
@@ -2219,7 +2223,7 @@ vect_recog_rotate_pattern (stmt_vec_info stmt_vinfo, tree *type_out)
}
type = TREE_TYPE (lhs);
- vectype = get_vectype_for_scalar_type (type);
+ vectype = get_vectype_for_scalar_type (vinfo, type);
if (vectype == NULL_TREE)
return NULL;
@@ -2285,7 +2289,7 @@ vect_recog_rotate_pattern (stmt_vec_info stmt_vinfo, tree *type_out)
&& dt != vect_external_def)
return NULL;
- vectype = get_vectype_for_scalar_type (type);
+ vectype = get_vectype_for_scalar_type (vinfo, type);
if (vectype == NULL_TREE)
return NULL;
@@ -2404,7 +2408,7 @@ vect_recog_rotate_pattern (stmt_vec_info stmt_vinfo, tree *type_out)
}
else
{
- tree vecstype = get_vectype_for_scalar_type (stype);
+ tree vecstype = get_vectype_for_scalar_type (vinfo, stype);
if (vecstype == NULL_TREE)
return NULL;
@@ -2533,7 +2537,7 @@ vect_recog_vector_vector_shift_pattern (stmt_vec_info stmt_vinfo,
if (!def_vinfo)
return NULL;
- *type_out = get_vectype_for_scalar_type (TREE_TYPE (oprnd0));
+ *type_out = get_vectype_for_scalar_type (vinfo, TREE_TYPE (oprnd0));
if (*type_out == NULL_TREE)
return NULL;
@@ -2556,7 +2560,8 @@ vect_recog_vector_vector_shift_pattern (stmt_vec_info stmt_vinfo,
TYPE_PRECISION (TREE_TYPE (oprnd1)));
def = vect_recog_temp_ssa_var (TREE_TYPE (rhs1), NULL);
def_stmt = gimple_build_assign (def, BIT_AND_EXPR, rhs1, mask);
- tree vecstype = get_vectype_for_scalar_type (TREE_TYPE (rhs1));
+ tree vecstype = get_vectype_for_scalar_type (vinfo,
+ TREE_TYPE (rhs1));
append_pattern_def_seq (stmt_vinfo, def_stmt, vecstype);
}
}
@@ -2751,7 +2756,7 @@ vect_synth_mult_by_constant (tree op, tree val,
if (!possible)
return NULL;
- tree vectype = get_vectype_for_scalar_type (multtype);
+ tree vectype = get_vectype_for_scalar_type (vinfo, multtype);
if (!vectype
|| !target_supports_mult_synth_alg (&alg, variant,
@@ -2897,6 +2902,7 @@ vect_synth_mult_by_constant (tree op, tree val,
static gimple *
vect_recog_mult_pattern (stmt_vec_info stmt_vinfo, tree *type_out)
{
+ vec_info *vinfo = stmt_vinfo->vinfo;
gimple *last_stmt = stmt_vinfo->stmt;
tree oprnd0, oprnd1, vectype, itype;
gimple *pattern_stmt;
@@ -2917,7 +2923,7 @@ vect_recog_mult_pattern (stmt_vec_info stmt_vinfo, tree *type_out)
|| !type_has_mode_precision_p (itype))
return NULL;
- vectype = get_vectype_for_scalar_type (itype);
+ vectype = get_vectype_for_scalar_type (vinfo, itype);
if (vectype == NULL_TREE)
return NULL;
@@ -2985,6 +2991,7 @@ vect_recog_mult_pattern (stmt_vec_info stmt_vinfo, tree *type_out)
static gimple *
vect_recog_divmod_pattern (stmt_vec_info stmt_vinfo, tree *type_out)
{
+ vec_info *vinfo = stmt_vinfo->vinfo;
gimple *last_stmt = stmt_vinfo->stmt;
tree oprnd0, oprnd1, vectype, itype, cond;
gimple *pattern_stmt, *def_stmt;
@@ -3017,7 +3024,7 @@ vect_recog_divmod_pattern (stmt_vec_info stmt_vinfo, tree *type_out)
return NULL;
scalar_int_mode itype_mode = SCALAR_INT_TYPE_MODE (itype);
- vectype = get_vectype_for_scalar_type (itype);
+ vectype = get_vectype_for_scalar_type (vinfo, itype);
if (vectype == NULL_TREE)
return NULL;
@@ -3115,7 +3122,7 @@ vect_recog_divmod_pattern (stmt_vec_info stmt_vinfo, tree *type_out)
{
tree utype
= build_nonstandard_integer_type (prec, 1);
- tree vecutype = get_vectype_for_scalar_type (utype);
+ tree vecutype = get_vectype_for_scalar_type (vinfo, utype);
tree shift
= build_int_cst (utype, GET_MODE_BITSIZE (itype_mode)
- tree_log2 (oprnd1));
@@ -3433,6 +3440,7 @@ vect_recog_divmod_pattern (stmt_vec_info stmt_vinfo, tree *type_out)
static gimple *
vect_recog_mixed_size_cond_pattern (stmt_vec_info stmt_vinfo, tree *type_out)
{
+ vec_info *vinfo = stmt_vinfo->vinfo;
gimple *last_stmt = stmt_vinfo->stmt;
tree cond_expr, then_clause, else_clause;
tree type, vectype, comp_vectype, itype = NULL_TREE, vecitype;
@@ -3455,7 +3463,7 @@ vect_recog_mixed_size_cond_pattern (stmt_vec_info stmt_vinfo, tree *type_out)
return NULL;
comp_scalar_type = TREE_TYPE (TREE_OPERAND (cond_expr, 0));
- comp_vectype = get_vectype_for_scalar_type (comp_scalar_type);
+ comp_vectype = get_vectype_for_scalar_type (vinfo, comp_scalar_type);
if (comp_vectype == NULL_TREE)
return NULL;
@@ -3503,7 +3511,7 @@ vect_recog_mixed_size_cond_pattern (stmt_vec_info stmt_vinfo, tree *type_out)
if (GET_MODE_BITSIZE (type_mode) == cmp_mode_size)
return NULL;
- vectype = get_vectype_for_scalar_type (type);
+ vectype = get_vectype_for_scalar_type (vinfo, type);
if (vectype == NULL_TREE)
return NULL;
@@ -3518,7 +3526,7 @@ vect_recog_mixed_size_cond_pattern (stmt_vec_info stmt_vinfo, tree *type_out)
|| GET_MODE_BITSIZE (SCALAR_TYPE_MODE (itype)) != cmp_mode_size)
return NULL;
- vecitype = get_vectype_for_scalar_type (itype);
+ vecitype = get_vectype_for_scalar_type (vinfo, itype);
if (vecitype == NULL_TREE)
return NULL;
@@ -3612,7 +3620,7 @@ check_bool_pattern (tree var, vec_info *vinfo, hash_set<gimple *> &stmts)
if (stmt_could_throw_p (cfun, def_stmt))
return false;
- comp_vectype = get_vectype_for_scalar_type (TREE_TYPE (rhs1));
+ comp_vectype = get_vectype_for_scalar_type (vinfo, TREE_TYPE (rhs1));
if (comp_vectype == NULL_TREE)
return false;
@@ -3627,7 +3635,7 @@ check_bool_pattern (tree var, vec_info *vinfo, hash_set<gimple *> &stmts)
scalar_mode mode = SCALAR_TYPE_MODE (TREE_TYPE (rhs1));
tree itype
= build_nonstandard_integer_type (GET_MODE_BITSIZE (mode), 1);
- vecitype = get_vectype_for_scalar_type (itype);
+ vecitype = get_vectype_for_scalar_type (vinfo, itype);
if (vecitype == NULL_TREE)
return false;
}
@@ -3656,10 +3664,11 @@ check_bool_pattern (tree var, vec_info *vinfo, hash_set<gimple *> &stmts)
static tree
adjust_bool_pattern_cast (tree type, tree var, stmt_vec_info stmt_info)
{
+ vec_info *vinfo = stmt_info->vinfo;
gimple *cast_stmt = gimple_build_assign (vect_recog_temp_ssa_var (type, NULL),
NOP_EXPR, var);
append_pattern_def_seq (stmt_info, cast_stmt,
- get_vectype_for_scalar_type (type));
+ get_vectype_for_scalar_type (vinfo, type));
return gimple_assign_lhs (cast_stmt);
}
@@ -3673,6 +3682,7 @@ static void
adjust_bool_pattern (tree var, tree out_type,
stmt_vec_info stmt_info, hash_map <tree, tree> &defs)
{
+ vec_info *vinfo = stmt_info->vinfo;
gimple *stmt = SSA_NAME_DEF_STMT (var);
enum tree_code rhs_code, def_rhs_code;
tree itype, cond_expr, rhs1, rhs2, irhs1, irhs2;
@@ -3834,7 +3844,7 @@ adjust_bool_pattern (tree var, tree out_type,
gimple_set_location (pattern_stmt, loc);
append_pattern_def_seq (stmt_info, pattern_stmt,
- get_vectype_for_scalar_type (itype));
+ get_vectype_for_scalar_type (vinfo, itype));
defs.put (var, gimple_assign_lhs (pattern_stmt));
}
@@ -3937,7 +3947,7 @@ search_type_for_mask_1 (tree var, vec_info *vinfo,
break;
}
- comp_vectype = get_vectype_for_scalar_type (TREE_TYPE (rhs1));
+ comp_vectype = get_vectype_for_scalar_type (vinfo, TREE_TYPE (rhs1));
if (comp_vectype == NULL_TREE)
{
res = NULL_TREE;
@@ -4052,7 +4062,7 @@ vect_recog_bool_pattern (stmt_vec_info stmt_vinfo, tree *type_out)
if (! INTEGRAL_TYPE_P (TREE_TYPE (lhs))
|| TYPE_PRECISION (TREE_TYPE (lhs)) == 1)
return NULL;
- vectype = get_vectype_for_scalar_type (TREE_TYPE (lhs));
+ vectype = get_vectype_for_scalar_type (vinfo, TREE_TYPE (lhs));
if (vectype == NULL_TREE)
return NULL;
@@ -4089,7 +4099,7 @@ vect_recog_bool_pattern (stmt_vec_info stmt_vinfo, tree *type_out)
if (!useless_type_conversion_p (type, TREE_TYPE (lhs)))
{
- tree new_vectype = get_vectype_for_scalar_type (type);
+ tree new_vectype = get_vectype_for_scalar_type (vinfo, type);
append_pattern_def_seq (stmt_vinfo, pattern_stmt, new_vectype);
lhs = vect_recog_temp_ssa_var (TREE_TYPE (lhs), NULL);
@@ -4105,7 +4115,7 @@ vect_recog_bool_pattern (stmt_vec_info stmt_vinfo, tree *type_out)
else if (rhs_code == COND_EXPR
&& TREE_CODE (var) == SSA_NAME)
{
- vectype = get_vectype_for_scalar_type (TREE_TYPE (lhs));
+ vectype = get_vectype_for_scalar_type (vinfo, TREE_TYPE (lhs));
if (vectype == NULL_TREE)
return NULL;
@@ -4119,7 +4129,7 @@ vect_recog_bool_pattern (stmt_vec_info stmt_vinfo, tree *type_out)
tree type
= build_nonstandard_integer_type (prec,
TYPE_UNSIGNED (TREE_TYPE (var)));
- if (get_vectype_for_scalar_type (type) == NULL_TREE)
+ if (get_vectype_for_scalar_type (vinfo, type) == NULL_TREE)
return NULL;
if (!check_bool_pattern (var, vinfo, bool_stmts))
@@ -4163,7 +4173,7 @@ vect_recog_bool_pattern (stmt_vec_info stmt_vinfo, tree *type_out)
cst0 = build_int_cst (type, 0);
cst1 = build_int_cst (type, 1);
- new_vectype = get_vectype_for_scalar_type (type);
+ new_vectype = get_vectype_for_scalar_type (vinfo, type);
rhs = vect_recog_temp_ssa_var (type, NULL);
pattern_stmt = gimple_build_assign (rhs, COND_EXPR, var, cst1, cst0);
@@ -4264,12 +4274,12 @@ vect_recog_mask_conversion_pattern (stmt_vec_info stmt_vinfo, tree *type_out)
{
int rhs_index = internal_fn_stored_value_index (ifn);
tree rhs = gimple_call_arg (last_stmt, rhs_index);
- vectype1 = get_vectype_for_scalar_type (TREE_TYPE (rhs));
+ vectype1 = get_vectype_for_scalar_type (vinfo, TREE_TYPE (rhs));
}
else
{
lhs = gimple_call_lhs (last_stmt);
- vectype1 = get_vectype_for_scalar_type (TREE_TYPE (lhs));
+ vectype1 = get_vectype_for_scalar_type (vinfo, TREE_TYPE (lhs));
}
tree mask_arg = gimple_call_arg (last_stmt, mask_argno);
@@ -4322,7 +4332,7 @@ vect_recog_mask_conversion_pattern (stmt_vec_info stmt_vinfo, tree *type_out)
/* Check for cond expression requiring mask conversion. */
if (rhs_code == COND_EXPR)
{
- vectype1 = get_vectype_for_scalar_type (TREE_TYPE (lhs));
+ vectype1 = get_vectype_for_scalar_type (vinfo, TREE_TYPE (lhs));
if (TREE_CODE (rhs1) == SSA_NAME)
{
@@ -4388,7 +4398,8 @@ vect_recog_mask_conversion_pattern (stmt_vec_info stmt_vinfo, tree *type_out)
tree wide_scalar_type = build_nonstandard_integer_type
(tree_to_uhwi (TYPE_SIZE (TREE_TYPE (vectype1))),
TYPE_UNSIGNED (rhs1_type));
- tree vectype3 = get_vectype_for_scalar_type (wide_scalar_type);
+ tree vectype3 = get_vectype_for_scalar_type (vinfo,
+ wide_scalar_type);
if (expand_vec_cond_expr_p (vectype1, vectype3, TREE_CODE (rhs1)))
return NULL;
}
@@ -4544,10 +4555,11 @@ vect_add_conversion_to_pattern (tree type, tree value, stmt_vec_info stmt_info)
if (useless_type_conversion_p (type, TREE_TYPE (value)))
return value;
+ vec_info *vinfo = stmt_info->vinfo;
tree new_value = vect_recog_temp_ssa_var (type, NULL);
gassign *conversion = gimple_build_assign (new_value, CONVERT_EXPR, value);
append_pattern_def_seq (stmt_info, conversion,
- get_vectype_for_scalar_type (type));
+ get_vectype_for_scalar_type (vinfo, type));
return new_value;
}
@@ -4583,7 +4595,8 @@ vect_recog_gather_scatter_pattern (stmt_vec_info stmt_info, tree *type_out)
return NULL;
/* Convert the mask to the right form. */
- tree gs_vectype = get_vectype_for_scalar_type (gs_info.element_type);
+ tree gs_vectype = get_vectype_for_scalar_type (loop_vinfo,
+ gs_info.element_type);
if (mask)
mask = vect_convert_mask_for_vectype (mask, gs_vectype, stmt_info,
loop_vinfo);