From: Richard Biener Date: Fri, 11 Sep 2020 11:51:58 +0000 (+0200) Subject: tree-optimization/97020 - account SLP cost in loop vect again X-Git-Tag: basepoints/gcc-12~5109 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8d3767c30240c901a493d82d9d20f306b2f0152d;p=thirdparty%2Fgcc.git tree-optimization/97020 - account SLP cost in loop vect again 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 PR tree-optimization/97020 * tree-vect-slp.c (vect_slp_analyze_operations): Apply SLP costs when doing loop vectorization. --- diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c index 519cd6a72541..15912515caae 100644 --- a/gcc/tree-vect-slp.c +++ b/gcc/tree-vect-slp.c @@ -3163,8 +3163,15 @@ vect_slp_analyze_operations (vec_info *vinfo) 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 (vinfo)) + instance->cost_vec = cost_vec; + else + { + add_stmt_costs (vinfo, vinfo->target_cost_data, &cost_vec); + cost_vec.release (); + } } }