aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vectorizer.h
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2021-11-10 12:31:00 +0000
committerRichard Sandiford <richard.sandiford@arm.com>2021-11-10 12:31:00 +0000
commit772d76acb5aead98eb3c47a78363d867287d5e77 (patch)
tree7e869ef49d54c0c480c4f5e23e192d7ac830fff2 /gcc/tree-vectorizer.h
parent4725f62789f25b17967695203d7ee821221e2dd6 (diff)
downloadgcc-772d76acb5aead98eb3c47a78363d867287d5e77.zip
gcc-772d76acb5aead98eb3c47a78363d867287d5e77.tar.gz
gcc-772d76acb5aead98eb3c47a78363d867287d5e77.tar.bz2
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.
Diffstat (limited to 'gcc/tree-vectorizer.h')
-rw-r--r--gcc/tree-vectorizer.h16
1 files changed, 9 insertions, 7 deletions
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