From 772d76acb5aead98eb3c47a78363d867287d5e77 Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Wed, 10 Nov 2021 12:31:00 +0000 Subject: vect: Remove vec_outside/inside_cost fields The vector costs now use a common base class instead of being completely abstract. This means that there's no longer a need to record the inside and outside costs separately. gcc/ * tree-vectorizer.h (_loop_vec_info): Remove vec_outside_cost and vec_inside_cost. (vector_costs::outside_cost): New function. * tree-vect-loop.c (_loop_vec_info::_loop_vec_info): Update after above. (vect_estimate_min_profitable_iters): Likewise. (vect_better_loop_vinfo_p): Get the inside and outside costs from the loop_vec_infos' vector_costs. --- gcc/tree-vectorizer.h | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'gcc/tree-vectorizer.h') diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h index 58c296d..72eed98 100644 --- a/gcc/tree-vectorizer.h +++ b/gcc/tree-vectorizer.h @@ -724,13 +724,6 @@ public: /* Cost of a single scalar iteration. */ int single_scalar_iteration_cost; - /* The cost of the vector prologue and epilogue, including peeled - iterations and set-up code. */ - int vec_outside_cost; - - /* The cost of the vector loop body. */ - int vec_inside_cost; - /* The factor used to over weight those statements in an inner loop relative to the loop being vectorized. */ unsigned int inner_loop_cost_factor; @@ -1429,6 +1422,7 @@ public: unsigned int prologue_cost () const; unsigned int body_cost () const; unsigned int epilogue_cost () const; + unsigned int outside_cost () const; protected: unsigned int record_stmt_cost (stmt_vec_info, vect_cost_model_location, @@ -1489,6 +1483,14 @@ vector_costs::epilogue_cost () const return m_costs[vect_epilogue]; } +/* Return the cost of the prologue and epilogue code (in abstract units). */ + +inline unsigned int +vector_costs::outside_cost () const +{ + return prologue_cost () + epilogue_cost (); +} + #define VECT_MAX_COST 1000 /* The maximum number of intermediate steps required in multi-step type -- cgit v1.1