From e4020b28d02a00d478a3a769855ae6a8d9cc6b26 Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Wed, 13 Nov 2019 09:03:07 +0000 Subject: Don't assign a cost to vectorizable_assignment vectorizable_assignment handles true SSA-to-SSA copies (which hopefully we don't see in practice) and no-op conversions that are required to maintain correct gimple, such as changes between signed and unsigned types. These cases shouldn't generate any code and so shouldn't count against either the scalar or vector costs. Later patches test this, but it seemed worth splitting out. 2019-11-13 Richard Sandiford gcc/ * tree-vectorizer.h (vect_nop_conversion_p): Declare. * tree-vect-stmts.c (vect_nop_conversion_p): New function. (vectorizable_assignment): Don't add a cost for nop conversions. * tree-vect-loop.c (vect_compute_single_scalar_iteration_cost): Likewise. * tree-vect-slp.c (vect_bb_slp_scalar_cost): Likewise. From-SVN: r278122 --- gcc/tree-vectorizer.h | 1 + 1 file changed, 1 insertion(+) (limited to 'gcc/tree-vectorizer.h') diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h index e556e0e..e93ccc7 100644 --- a/gcc/tree-vectorizer.h +++ b/gcc/tree-vectorizer.h @@ -1650,6 +1650,7 @@ extern tree vect_get_vec_def_for_stmt_copy (vec_info *, tree); extern bool vect_transform_stmt (stmt_vec_info, gimple_stmt_iterator *, slp_tree, slp_instance); extern void vect_remove_stores (stmt_vec_info); +extern bool vect_nop_conversion_p (stmt_vec_info); extern opt_result vect_analyze_stmt (stmt_vec_info, bool *, slp_tree, slp_instance, stmt_vector_for_cost *); extern void vect_get_load_cost (stmt_vec_info, int, bool, -- cgit v1.1