Richard Biener <rguent...@suse.de> writes: > @@ -5742,8 +5740,14 @@ vectorize_fold_left_reduction (stmt_vec_info stmt_info, > auto_vec<tree> vec_oprnds0; > if (slp_node) > { > - vect_get_vec_defs (op0, NULL_TREE, stmt_info, &vec_oprnds0, NULL, > - slp_node); > + auto_vec<vec<tree> > vec_defs (2); > + auto_vec<tree> sops(2); > + sops.quick_push (ops[0]); > + sops.quick_push (ops[1]); > + vect_get_slp_defs (sops, slp_node, &vec_defs); > + vec_oprnds0.safe_splice (vec_defs[1 - reduc_index]); > + vec_defs[0].release (); > + vec_defs[1].release (); > group_size = SLP_TREE_SCALAR_STMTS (slp_node).length (); > scalar_dest_def_info = SLP_TREE_SCALAR_STMTS (slp_node)[group_size - > 1]; > }
Ewww. :-) Would be nice if it was easier to do the right thing. But are you sure we want this for fold-left reductions? The other operand isn't supposed to be vectorised -- it stays a scalar even in the vector loop. Thanks, Richard