The previous re-org made the cost of SLP vector stmts in loop
vectorization ignored. The following rectifies this mistake.
2020-09-11 Richard Biener <rguenther@suse.de>
PR tree-optimization/97020
* tree-vect-slp.c (vect_slp_analyze_operations): Apply
SLP costs when doing loop vectorization.
visited.add (*x);
i++;
- /* Remember the SLP graph entry cost for later. */
- instance->cost_vec = cost_vec;
+ /* For BB vectorization remember the SLP graph entry
+ cost for later. */
+ if (is_a <bb_vec_info> (vinfo))
+ instance->cost_vec = cost_vec;
+ else
+ {
+ add_stmt_costs (vinfo, vinfo->target_cost_data, &cost_vec);
+ cost_vec.release ();
+ }
}
}