tree-optimization/101003 - use pattern defs when linearizing

We of course have to use pattern stmt defs for the linearized
chain operands which is what I failed to ensure.

2021-06-10  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/101003
	* tree-vect-slp.c (vect_build_slp_tree_2): Appropriately
	use the pattern stmt defs when linearizing a chain.
This commit is contained in:
Richard Biener 2021-06-10 10:39:31 +02:00
parent 5ad76ad7f5
commit cce1697e6f

View file

@ -1806,6 +1806,11 @@ vect_build_slp_tree_2 (vec_info *vinfo, slp_tree node,
stmt_vec_info def_stmt_info;
bool res = vect_is_simple_use (op, vinfo, &dt, &def_stmt_info);
gcc_assert (res);
if (dt == vect_internal_def)
{
def_stmt_info = vect_stmt_to_vectorize (def_stmt_info);
op = gimple_get_lhs (def_stmt_info->stmt);
}
gimple *use_stmt;
use_operand_p use_p;
if (dt == vect_internal_def