aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2020-09-11 13:51:58 +0200
committerRichard Biener <rguenther@suse.de>2020-09-11 13:53:34 +0200
commit8d3767c30240c901a493d82d9d20f306b2f0152d (patch)
treef95b7887185275f930095a0859c603e6bc3cf585
parent2c1d809e93e983fa9dde6d4a14c23193608fed68 (diff)
downloadgcc-8d3767c30240c901a493d82d9d20f306b2f0152d.zip
gcc-8d3767c30240c901a493d82d9d20f306b2f0152d.tar.gz
gcc-8d3767c30240c901a493d82d9d20f306b2f0152d.tar.bz2
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 <rguenther@suse.de> PR tree-optimization/97020 * tree-vect-slp.c (vect_slp_analyze_operations): Apply SLP costs when doing loop vectorization.
-rw-r--r--gcc/tree-vect-slp.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c
index 519cd6a..1591251 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 <bb_vec_info> (vinfo))
+ instance->cost_vec = cost_vec;
+ else
+ {
+ add_stmt_costs (vinfo, vinfo->target_cost_data, &cost_vec);
+ cost_vec.release ();
+ }
}
}