diff options
author | Richard Sandiford <richard.sandiford@arm.com> | 2019-11-13 09:03:07 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2019-11-13 09:03:07 +0000 |
commit | e4020b28d02a00d478a3a769855ae6a8d9cc6b26 (patch) | |
tree | 8795d85f2e900a5d8c52ef2b19865109b138051a /gcc/tree-vect-loop.c | |
parent | 3f446c27195400aea98ff9c37ed2651ab54f7c03 (diff) | |
download | gcc-e4020b28d02a00d478a3a769855ae6a8d9cc6b26.zip gcc-e4020b28d02a00d478a3a769855ae6a8d9cc6b26.tar.gz gcc-e4020b28d02a00d478a3a769855ae6a8d9cc6b26.tar.bz2 |
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 <richard.sandiford@arm.com>
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
Diffstat (limited to 'gcc/tree-vect-loop.c')
-rw-r--r-- | gcc/tree-vect-loop.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c index d9f4134..75ec9e6 100644 --- a/gcc/tree-vect-loop.c +++ b/gcc/tree-vect-loop.c @@ -1125,7 +1125,9 @@ vect_compute_single_scalar_iteration_cost (loop_vec_info loop_vinfo) else kind = scalar_store; } - else + else if (vect_nop_conversion_p (stmt_info)) + continue; + else kind = scalar_stmt; record_stmt_cost (&LOOP_VINFO_SCALAR_ITERATION_COST (loop_vinfo), |