diff options
| author | Richard Sandiford <richard.sandiford@arm.com> | 2021-11-10 12:31:02 +0000 |
|---|---|---|
| committer | Richard Sandiford <richard.sandiford@arm.com> | 2021-11-10 12:31:02 +0000 |
| commit | 0612883d9dc6eebecdbe937893b86597acae237c (patch) | |
| tree | 7e70dd558bb1fe1a5e589f6325cfce88f48f0ec3 /gcc/tree-vect-slp.c | |
| parent | 6ddc6a57a74c3a388eb1626e59005f54c6e66c57 (diff) | |
| download | gcc-0612883d9dc6eebecdbe937893b86597acae237c.zip gcc-0612883d9dc6eebecdbe937893b86597acae237c.tar.gz gcc-0612883d9dc6eebecdbe937893b86597acae237c.tar.bz2 | |
vect: Pass scalar_costs to finish_cost
When finishing the vector costs, it can be useful to know
what the associated scalar costs were. This allows targets
to read information collected about the original scalar loop
when trying to make a final judgement about the cost of the
vector code.
This patch therefore passes the scalar costs to
vector_costs::finish_cost. The parameter is null for the
scalar costs themselves.
gcc/
* tree-vectorizer.h (vector_costs::finish_cost): Take the
corresponding scalar costs as a parameter.
(finish_cost): Likewise.
* tree-vect-loop.c (vect_compute_single_scalar_iteration_cost)
(vect_estimate_min_profitable_iters): Update accordingly.
* tree-vect-slp.c (vect_bb_vectorization_profitable_p): Likewise.
* tree-vectorizer.c (vector_costs::finish_cost): Likewise.
* config/aarch64/aarch64.c (aarch64_vector_costs::finish_cost):
Likewise.
* config/rs6000/rs6000.c (rs6000_cost_data::finish_cost): Likewise.
Diffstat (limited to 'gcc/tree-vect-slp.c')
| -rw-r--r-- | gcc/tree-vect-slp.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c index d437bfd..94c7549 100644 --- a/gcc/tree-vect-slp.c +++ b/gcc/tree-vect-slp.c @@ -5344,7 +5344,8 @@ vect_bb_vectorization_profitable_p (bb_vec_info bb_vinfo, while (si < li_scalar_costs.length () && li_scalar_costs[si].first == sl); unsigned dummy; - finish_cost (scalar_target_cost_data, &dummy, &scalar_cost, &dummy); + finish_cost (scalar_target_cost_data, nullptr, + &dummy, &scalar_cost, &dummy); delete scalar_target_cost_data; /* Complete the target-specific vector cost calculation. */ @@ -5356,8 +5357,8 @@ vect_bb_vectorization_profitable_p (bb_vec_info bb_vinfo, } while (vi < li_vector_costs.length () && li_vector_costs[vi].first == vl); - finish_cost (vect_target_cost_data, &vec_prologue_cost, - &vec_inside_cost, &vec_epilogue_cost); + finish_cost (vect_target_cost_data, scalar_target_cost_data, + &vec_prologue_cost, &vec_inside_cost, &vec_epilogue_cost); delete vect_target_cost_data; vec_outside_cost = vec_prologue_cost + vec_epilogue_cost; |
