aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2020-06-03 13:17:11 +0200
committerRichard Biener <rguenther@suse.de>2020-06-03 13:18:55 +0200
commitf05c84ac139ccd5398542369aad2b5ff3059ced4 (patch)
tree3cc08c620728b737e9c89957ed514c79f9b261f9 /gcc
parent93535a2b40367e6f68433295b37dc52c0e9c2c55 (diff)
downloadgcc-f05c84ac139ccd5398542369aad2b5ff3059ced4.zip
gcc-f05c84ac139ccd5398542369aad2b5ff3059ced4.tar.gz
gcc-f05c84ac139ccd5398542369aad2b5ff3059ced4.tar.bz2
simplify visited flag unsetting in SLP scalar cost computation
This changes the loop over all stmts to a loop over all costed stmts. 2020-06-03 Richard Biener <rguenther@suse.de> * tree-vect-slp.c (vect_bb_vectorization_profitable_p): Loop over the cost vector to unset the visited flag on stmts.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/tree-vect-slp.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c
index 836defc..f1d6194 100644
--- a/gcc/tree-vect-slp.c
+++ b/gcc/tree-vect-slp.c
@@ -3078,6 +3078,11 @@ vect_bb_vectorization_profitable_p (bb_vec_info bb_vinfo)
SLP_INSTANCE_TREE (instance),
&life, &scalar_costs, visited);
}
+ /* Unset visited flag. */
+ stmt_info_for_cost *si;
+ FOR_EACH_VEC_ELT (scalar_costs, i, si)
+ gimple_set_visited (si->stmt_info->stmt, false);
+
void *target_cost_data = init_cost (NULL);
add_stmt_costs (bb_vinfo, target_cost_data, &scalar_costs);
scalar_costs.release ();
@@ -3085,11 +3090,6 @@ vect_bb_vectorization_profitable_p (bb_vec_info bb_vinfo)
finish_cost (target_cost_data, &dummy, &scalar_cost, &dummy);
destroy_cost_data (target_cost_data);
- /* Unset visited flag. */
- for (gimple_stmt_iterator gsi = bb_vinfo->region_begin;
- gsi_stmt (gsi) != gsi_stmt (bb_vinfo->region_end); gsi_next (&gsi))
- gimple_set_visited (gsi_stmt (gsi), false);
-
/* Complete the target-specific cost calculation. */
finish_cost (BB_VINFO_TARGET_COST_DATA (bb_vinfo), &vec_prologue_cost,
&vec_inside_cost, &vec_epilogue_cost);