aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vect-loop.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2020-11-04 11:37:52 +0100
committerRichard Biener <rguenther@suse.de>2020-11-04 12:41:25 +0100
commit1272573a6b2257a7ed525a81e26862a563fb68a0 (patch)
tree9ec31f960b967ba8d4420a0105648147c421d8de /gcc/tree-vect-loop.c
parent1e9f339d946b8296e3785bec77e03d71b487d689 (diff)
downloadgcc-1272573a6b2257a7ed525a81e26862a563fb68a0.zip
gcc-1272573a6b2257a7ed525a81e26862a563fb68a0.tar.gz
gcc-1272573a6b2257a7ed525a81e26862a563fb68a0.tar.bz2
add costing to SLP vectorized PHIs
I forgot to cost vectorized PHIs. Scalar PHIs are just costed as scalar_stmt so the following costs vector PHIs as vector_stmt. 2020-11-04 Richard Biener <rguenther@suse.de> * tree-vectorizer.h (vectorizable_phi): Adjust prototype. * tree-vect-stmts.c (vect_transform_stmt): Adjust. (vect_analyze_stmt): Pass cost_vec to vectorizable_phi. * tree-vect-loop.c (vectorizable_phi): Do costing.
Diffstat (limited to 'gcc/tree-vect-loop.c')
-rw-r--r--gcc/tree-vect-loop.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c
index 6cb2286..5e7188a 100644
--- a/gcc/tree-vect-loop.c
+++ b/gcc/tree-vect-loop.c
@@ -7548,7 +7548,7 @@ vectorizable_lc_phi (loop_vec_info loop_vinfo,
bool
vectorizable_phi (vec_info *,
stmt_vec_info stmt_info, gimple **vec_stmt,
- slp_tree slp_node)
+ slp_tree slp_node, stmt_vector_for_cost *cost_vec)
{
if (!is_a <gphi *> (stmt_info->stmt) || !slp_node)
return false;
@@ -7577,6 +7577,8 @@ vectorizable_phi (vec_info *,
"incompatible vector types for invariants\n");
return false;
}
+ record_stmt_cost (cost_vec, SLP_TREE_NUMBER_OF_VEC_STMTS (slp_node),
+ vector_stmt, stmt_info, vectype, 0, vect_body);
STMT_VINFO_TYPE (stmt_info) = phi_info_type;
return true;
}