]> git.ipfire.org Git - thirdparty/gcc.git/commit
vect: Keep scalar costs around longer
authorRichard Sandiford <richard.sandiford@arm.com>
Wed, 10 Nov 2021 12:31:01 +0000 (12:31 +0000)
committerRichard Sandiford <richard.sandiford@arm.com>
Wed, 10 Nov 2021 12:31:01 +0000 (12:31 +0000)
commit6ddc6a57a74c3a388eb1626e59005f54c6e66c57
treead74173fbfebe5e04d3a357472cc5161ffd1611f
parent5720a9d5beacb558c1ddccbbfef9f9e4f91b14cf
vect: Keep scalar costs around longer

The scalar costs for a loop are fleeting, with only the final
single_scalar_iteration_cost being kept for later comparison.
This patch replaces single_scalar_iteration_cost with the cost
structure, so that (with later patches) it's possible for targets
to examine other target-specific cost properties as well.  This will
be done by passing the scalar costs to hooks where appropriate;
targets shouldn't try to read the information directly from
loop_vec_infos.

gcc/
* tree-vectorizer.h (_loop_vec_info::scalar_costs): New member
variable.
(_loop_vec_info::single_scalar_iteration_cost): Delete.
(LOOP_VINFO_SINGLE_SCALAR_ITERATION_COST): Delete.
(vector_costs::total_cost): New function.
* tree-vect-loop.c (_loop_vec_info::_loop_vec_info): Update
after above changes.
(_loop_vec_info::~_loop_vec_info): Delete scalar_costs.
(vect_compute_single_scalar_iteration_cost): Store the costs
in loop_vinfo->scalar_costs.
(vect_estimate_min_profitable_iters): Get the scalar cost from
loop_vinfo->scalar_costs.
gcc/tree-vect-loop.c
gcc/tree-vectorizer.h