if (stmt_vectype)
{
- if (known_le (TYPE_VECTOR_SUBPARTS (stmt_vectype), 1U))
- return opt_result::failure_at (STMT_VINFO_STMT (stmt_info),
- "not vectorized: unsupported "
- "data-type in %G",
- STMT_VINFO_STMT (stmt_info));
-
if (STMT_VINFO_VECTYPE (stmt_info))
/* The only case when a vectype had been already set is for stmts
that contain a data ref, or for "pattern-stmts" (stmts generated
scalar_type);
vectype = get_vectype_for_scalar_type (loop_vinfo, scalar_type);
- if (!vectype
- || known_le (TYPE_VECTOR_SUBPARTS (vectype), 1U))
+ if (!vectype)
return opt_result::failure_at (phi,
"not vectorized: unsupported "
"data-type %T\n",
hash_set<slp_tree> visited;
FOR_EACH_VEC_ELT (slp_instances, i, instance)
{
- /* FORNOW: SLP if you can. */
+ slp_tree root = SLP_INSTANCE_TREE (instance);
+
/* All unroll factors have the form:
GET_MODE_SIZE (vinfo->vector_mode) * X
for some rational X, so they must have a common multiple. */
- vect_update_slp_vf_for_node (SLP_INSTANCE_TREE (instance),
- unrolling_factor, visited);
+ vect_update_slp_vf_for_node (root, unrolling_factor, visited);
/* Mark all the stmts that belong to INSTANCE as PURE_SLP stmts. Later we
call vect_detect_hybrid_slp () to find stmts that need hybrid SLP and
loop-based vectorization. Such stmts will be marked as HYBRID. */
- vect_mark_slp_stmts (loop_vinfo, SLP_INSTANCE_TREE (instance));
- decided_to_slp++;
+ vect_mark_slp_stmts (loop_vinfo, root);
+
+ /* If all instances ended up with vector(1) T roots make sure to
+ not vectorize. RVV for example relies on loop vectorization
+ when some instances are essentially kept scalar. See PR121048. */
+ if (known_gt (TYPE_VECTOR_SUBPARTS (SLP_TREE_VECTYPE (root)), 1U))
+ decided_to_slp++;
}
LOOP_VINFO_SLP_UNROLLING_FACTOR (loop_vinfo) = unrolling_factor;