ok return 0. */
static int
vect_get_and_check_slp_defs (vec_info *vinfo, unsigned char swap,
+ bool *skip_args,
vec<stmt_vec_info> stmts, unsigned stmt_num,
vec<slp_oprnd_info> *oprnds_info)
{
return -1;
}
+ if (skip_args[i])
+ {
+ oprnd_info->def_stmts.quick_push (NULL);
+ oprnd_info->ops.quick_push (NULL_TREE);
+ oprnd_info->first_dt = vect_uninitialized_def;
+ continue;
+ }
+
if (def_stmt_info && is_pattern_stmt_p (def_stmt_info))
oprnd_info->any_pattern = true;
/* Now match the operand definition types to that of the first stmt. */
for (i = 0; i < number_of_oprnds;)
{
+ if (skip_args[i])
+ {
+ ++i;
+ continue;
+ }
+
oprnd_info = (*oprnds_info)[i];
dt = dts[i];
stmt_vec_info def_stmt_info = oprnd_info->def_stmts[stmt_num];
/* If the SLP node is a PHI (induction or reduction), terminate
the recursion. */
- bool skip_args[2] = { false, false };
+ bool *skip_args = XALLOCAVEC (bool, nops);
+ memset (skip_args, 0, nops);
if (loop_vec_info loop_vinfo = dyn_cast <loop_vec_info> (vinfo))
if (gphi *stmt = dyn_cast <gphi *> (stmt_info->stmt))
{
slp_oprnd_info oprnd_info;
FOR_EACH_VEC_ELT (stmts, i, stmt_info)
{
- int res = vect_get_and_check_slp_defs (vinfo, swap[i],
+ int res = vect_get_and_check_slp_defs (vinfo, swap[i], skip_args,
stmts, i, &oprnds_info);
if (res != 0)
matches[(res == -1) ? 0 : i] = false;
slp_tree child;
unsigned int j;
- if (oprnd_info->first_dt == vect_uninitialized_def)
+ /* We're skipping certain operands from processing, for example
+ outer loop reduction initial defs. */
+ if (skip_args[i])
{
- /* COND_EXPR have one too many eventually if the condition
- is a SSA name. */
- gcc_assert (i == 3 && nops == 4);
+ children.safe_push (NULL);
continue;
}
- /* We're skipping certain operands from processing, for example
- outer loop reduction initial defs. */
- if (i <= 1 && skip_args[i])
+ if (oprnd_info->first_dt == vect_uninitialized_def)
{
- children.safe_push (NULL);
+ /* COND_EXPR have one too many eventually if the condition
+ is a SSA name. */
+ gcc_assert (i == 3 && nops == 4);
continue;
}