/* Since we replace all stmts of a possibly longer scalar reduction
chain account for the extra scalar stmts for that. */
- record_stmt_cost (cost_vec, instance->remain_defs.length (), scalar_stmt,
- instance->root_stmts[0], 0, vect_body);
+ if (!instance->remain_defs.is_empty ())
+ record_stmt_cost (cost_vec, instance->remain_defs.length (), scalar_stmt,
+ instance->root_stmts[0], 0, vect_body);
return true;
}
if (nperms < 0)
return false;
- if (!gsi)
+ if (!gsi && nperms != 0)
record_stmt_cost (cost_vec, nperms, vec_perm, node, vectype, 0, vect_body);
return true;
{
vect_transform_slp_perm_load (vinfo, slp_node, vNULL, nullptr, vf,
true, &n_perms, nullptr);
- inside_cost = record_stmt_cost (cost_vec, n_perms, vec_perm,
- slp_node, 0, vect_body);
+ if (n_perms != 0)
+ inside_cost = record_stmt_cost (cost_vec, n_perms, vec_perm,
+ slp_node, 0, vect_body);
}
else
{