stmt_vec_info stmt_info, tree vectype,
int misalign,
vect_cost_model_location where) override;
- void finish_cost () override;
+ void finish_cost (const vector_costs *) override;
private:
void record_potential_advsimd_unrolling (loop_vec_info);
}
void
-aarch64_vector_costs::finish_cost ()
+aarch64_vector_costs::finish_cost (const vector_costs *scalar_costs)
{
loop_vec_info loop_vinfo = dyn_cast<loop_vec_info> (m_vinfo);
if (loop_vinfo
&& aarch64_use_new_vector_costs_p ())
m_costs[vect_body] = adjust_body_cost (m_costs[vect_body]);
- vector_costs::finish_cost ();
+ vector_costs::finish_cost (scalar_costs);
}
static void initialize_aarch64_code_model (struct gcc_options *);
stmt_vec_info stmt_info, tree vectype,
int misalign,
vect_cost_model_location where) override;
- void finish_cost () override;
+ void finish_cost (const vector_costs *) override;
protected:
void update_target_cost_per_stmt (vect_cost_for_stmt, stmt_vec_info,
}
void
-rs6000_cost_data::finish_cost ()
+rs6000_cost_data::finish_cost (const vector_costs *scalar_costs)
{
if (loop_vec_info loop_vinfo = dyn_cast<loop_vec_info> (m_vinfo))
{
m_costs[vect_body] += 10000;
}
- vector_costs::finish_cost ();
+ vector_costs::finish_cost (scalar_costs);
}
/* Implement targetm.loop_unroll_adjust. */
(void) add_stmt_cost (loop_vinfo->scalar_costs, si->count,
si->kind, si->stmt_info, si->vectype,
si->misalign, si->where);
- loop_vinfo->scalar_costs->finish_cost ();
+ loop_vinfo->scalar_costs->finish_cost (nullptr);
}
}
/* Complete the target-specific cost calculations. */
- finish_cost (loop_vinfo->vector_costs, &vec_prologue_cost,
- &vec_inside_cost, &vec_epilogue_cost);
+ finish_cost (loop_vinfo->vector_costs, loop_vinfo->scalar_costs,
+ &vec_prologue_cost, &vec_inside_cost, &vec_epilogue_cost);
vec_outside_cost = (int)(vec_prologue_cost + vec_epilogue_cost);
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. */
}
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;
/* See the comment above the declaration for details. */
void
-vector_costs::finish_cost ()
+vector_costs::finish_cost (const vector_costs *)
{
gcc_assert (!m_finished);
m_finished = true;
vect_cost_model_location where);
/* Finish calculating the cost of the code. The results can be
- read back using the functions below. */
- virtual void finish_cost ();
+ read back using the functions below.
+
+ If the costs describe vector code, SCALAR_COSTS gives the costs
+ of the corresponding scalar code, otherwise it is null. */
+ virtual void finish_cost (const vector_costs *scalar_costs);
/* The costs in THIS and OTHER both describe ways of vectorizing
a main loop. Return true if the costs described by THIS are
/* Alias targetm.vectorize.finish_cost. */
static inline void
-finish_cost (vector_costs *costs, unsigned *prologue_cost,
- unsigned *body_cost, unsigned *epilogue_cost)
+finish_cost (vector_costs *costs, const vector_costs *scalar_costs,
+ unsigned *prologue_cost, unsigned *body_cost,
+ unsigned *epilogue_cost)
{
- costs->finish_cost ();
+ costs->finish_cost (scalar_costs);
*prologue_cost = costs->prologue_cost ();
*body_cost = costs->body_cost ();
*epilogue_cost = costs->epilogue_cost ();