GCC Middle and Back End API Reference
|
#include <tree-vectorizer.h>
Public Member Functions | |
vector_costs (vec_info *, bool) | |
virtual | ~vector_costs () |
virtual unsigned int | add_stmt_cost (int count, vect_cost_for_stmt kind, stmt_vec_info stmt_info, slp_tree node, tree vectype, int misalign, vect_cost_model_location where) |
virtual void | finish_cost (const vector_costs *scalar_costs) |
virtual bool | better_main_loop_than_p (const vector_costs *other) const |
virtual bool | better_epilogue_loop_than_p (const vector_costs *other, loop_vec_info main_loop) const |
unsigned int | prologue_cost () const |
unsigned int | body_cost () const |
unsigned int | epilogue_cost () const |
unsigned int | outside_cost () const |
unsigned int | total_cost () const |
unsigned int | suggested_unroll_factor () const |
Protected Member Functions | |
unsigned int | record_stmt_cost (stmt_vec_info, vect_cost_model_location, unsigned int) |
unsigned int | adjust_cost_for_freq (stmt_vec_info, vect_cost_model_location, unsigned int) |
int | compare_inside_loop_cost (const vector_costs *) const |
int | compare_outside_loop_cost (const vector_costs *) const |
Protected Attributes | |
vec_info * | m_vinfo |
bool | m_costing_for_scalar |
unsigned int | m_costs [3] |
unsigned int | m_suggested_unroll_factor |
bool | m_finished |
Contains the scalar or vector costs for a vec_info.
Create costs for VINFO. COSTING_FOR_SCALAR is true if the costs are for scalar code, false if they are for vector code.
|
inlinevirtual |
|
virtual |
See the comment above the declaration for details.
References builtin_vectorization_cost(), count, and record_stmt_cost().
|
protected |
COST is the base cost we have calculated for an operation in location WHERE. If STMT_INFO is nonnull, use it to adjust the cost based on execution frequency (where appropriate). Return the adjusted cost.
References as_a(), LOOP_VINFO_INNER_LOOP_COST_FACTOR, stmt_in_inner_loop_p(), and vect_body.
|
virtual |
See the comment above the declaration for details.
References as_a(), body_cost(), CEIL, estimated_poly_value(), poly_int< N, C >::is_constant(), LOOP_VINFO_INT_NITERS, LOOP_VINFO_NITERS_KNOWN_P, LOOP_VINFO_USING_PARTIAL_VECTORS_P, LOOP_VINFO_VECT_FACTOR, m_vinfo, outside_cost(), POLY_VALUE_LIKELY, and POLY_VALUE_MAX.
Referenced by vect_better_loop_vinfo_p().
|
virtual |
See the comment above the declaration for details.
|
inline |
Return the cost of the body code (in abstract units).
References gcc_checking_assert, m_costs, m_finished, and vect_body.
Referenced by better_epilogue_loop_than_p(), compare_inside_loop_cost(), and total_cost().
|
protected |
A <=>-style subroutine of better_main_loop_than_p. Check whether we can determine the return value of better_main_loop_than_p by comparing the inside (loop body) costs of THIS and OTHER. Return: * -1 if better_main_loop_than_p should return true. * 1 if better_main_loop_than_p should return false. * 0 if we can't decide.
References as_a(), body_cost(), estimated_poly_value(), gcc_assert, likely_max_stmt_executions_int(), LOOP_VINFO_LOOP, LOOP_VINFO_VECT_FACTOR, m_vinfo, POLY_VALUE_LIKELY, POLY_VALUE_MAX, POLY_VALUE_MIN, and _loop_vec_info::vector_costs.
|
protected |
A <=>-style subroutine of better_main_loop_than_p, used when there is nothing to choose between the inside (loop body) costs of THIS and OTHER. Check whether we can determine the return value of better_main_loop_than_p by comparing the outside (prologue and epilogue) costs of THIS and OTHER. Return: * -1 if better_main_loop_than_p should return true. * 1 if better_main_loop_than_p should return false. * 0 if we can't decide.
References outside_cost().
|
inline |
Return the cost of the epilogue code (in abstract units).
References gcc_checking_assert, m_costs, m_finished, and vect_epilogue.
Referenced by outside_cost().
|
virtual |
See the comment above the declaration for details.
References gcc_assert.
Referenced by vect_compute_single_scalar_iteration_cost().
|
inline |
Return the cost of the prologue and epilogue code (in abstract units).
References epilogue_cost(), and prologue_cost().
Referenced by better_epilogue_loop_than_p(), compare_outside_loop_cost(), and total_cost().
|
inline |
Return the cost of the prologue code (in abstract units).
References gcc_checking_assert, m_costs, m_finished, and vect_prologue.
Referenced by outside_cost().
|
protected |
Record a base cost of COST units against WHERE. If STMT_INFO is nonnull, use it to adjust the cost based on execution frequency (where appropriate).
|
inline |
Return the suggested unroll factor.
References gcc_checking_assert, m_finished, and m_suggested_unroll_factor.
|
inline |
Return the cost of the prologue, body and epilogue code (in abstract units).
References body_cost(), and outside_cost().
Referenced by vect_estimate_min_profitable_iters().
|
protected |
|
protected |
Referenced by body_cost(), epilogue_cost(), and prologue_cost().
|
protected |
Referenced by body_cost(), epilogue_cost(), prologue_cost(), and suggested_unroll_factor().
|
protected |
Referenced by suggested_unroll_factor().
|
protected |
Referenced by better_epilogue_loop_than_p(), and compare_inside_loop_cost().