From 096f8215d2172ca4177cb26035e748d8f182fc8f Mon Sep 17 00:00:00 2001 From: Kewen Lin Date: Mon, 10 May 2021 22:13:27 -0500 Subject: vect: Add costing_for_scalar parameter to init_cost hook rs6000 port function rs6000_density_test wants to differentiate the current cost model is for the scalar version of a loop or block, or the vector version. As Richi suggested, this patch introduces one new parameter costing_for_scalar to init_cost hook to pass down this information explicitly. gcc/ChangeLog: * doc/tm.texi: Regenerated. * target.def (init_cost): Add new parameter costing_for_scalar. * targhooks.c (default_init_cost): Adjust for new parameter. * targhooks.h (default_init_cost): Likewise. * tree-vect-loop.c (_loop_vec_info::_loop_vec_info): Likewise. (vect_compute_single_scalar_iteration_cost): Likewise. (vect_analyze_loop_2): Likewise. * tree-vect-slp.c (_bb_vec_info::_bb_vec_info): Likewise. (vect_bb_vectorization_profitable_p): Likewise. * tree-vectorizer.h (init_cost): Likewise. * config/aarch64/aarch64.c (aarch64_init_cost): Likewise. * config/i386/i386.c (ix86_init_cost): Likewise. * config/rs6000/rs6000.c (rs6000_init_cost): Likewise. --- gcc/targhooks.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gcc/targhooks.c') diff --git a/gcc/targhooks.c b/gcc/targhooks.c index 952fad4..2e0fdb7 100644 --- a/gcc/targhooks.c +++ b/gcc/targhooks.c @@ -1373,7 +1373,8 @@ default_empty_mask_is_expensive (unsigned ifn) array of three unsigned ints, set it to zero, and return its address. */ void * -default_init_cost (class loop *loop_info ATTRIBUTE_UNUSED) +default_init_cost (class loop *loop_info ATTRIBUTE_UNUSED, + bool costing_for_scalar ATTRIBUTE_UNUSED) { unsigned *cost = XNEWVEC (unsigned, 3); cost[vect_prologue] = cost[vect_body] = cost[vect_epilogue] = 0; -- cgit v1.1