From 7002a33d1ba81e4577d965fb9daaee146b31faa8 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Thu, 4 Feb 2021 12:08:47 +0100 Subject: tree-optimization/98855 - fix some vectorizer cost issues This fixes us not costing vectorized bswap for SLP as well as avoiding biasing to the vectorized side when costing single-argument PHIs. Instead we assume coalescing here and cost them with zero cost for both the scalar and vectorized code. This doesn't fix the PR on its own. 2021-02-04 Richard Biener PR tree-optimization/98855 * tree-vect-loop.c (vectorizable_phi): Do not cost single-argument PHIs. * tree-vect-slp.c (vect_bb_slp_scalar_cost): Likewise. * tree-vect-stmts.c (vectorizable_bswap): Also perform costing for SLP operation. --- gcc/tree-vect-stmts.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'gcc/tree-vect-stmts.c') diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c index 5eb7b2d..0bc1cb1c 100644 --- a/gcc/tree-vect-stmts.c +++ b/gcc/tree-vect-stmts.c @@ -3002,13 +3002,12 @@ vectorizable_bswap (vec_info *vinfo, STMT_VINFO_TYPE (stmt_info) = call_vec_info_type; DUMP_VECT_SCOPE ("vectorizable_bswap"); - if (! slp_node) - { - record_stmt_cost (cost_vec, - 1, vector_stmt, stmt_info, 0, vect_prologue); - record_stmt_cost (cost_vec, - ncopies, vec_perm, stmt_info, 0, vect_body); - } + record_stmt_cost (cost_vec, + 1, vector_stmt, stmt_info, 0, vect_prologue); + record_stmt_cost (cost_vec, + slp_node + ? SLP_TREE_NUMBER_OF_VEC_STMTS (slp_node) : ncopies, + vec_perm, stmt_info, 0, vect_body); return true; } -- cgit v1.1