aarch64: Move more code into aarch64_vector_costs
authorRichard Sandiford <richard.sandiford@arm.com>
Thu, 4 Nov 2021 12:31:17 +0000 (12:31 +0000)
committerRichard Sandiford <richard.sandiford@arm.com>
Thu, 4 Nov 2021 12:31:17 +0000 (12:31 +0000)
commitd43fc1df7344e9cb705d3ca40217ff4e39aab5bf
tree65ab124859cb2ad7f43bf778518ed87865155af6
parent6239dd05127f1dc05f13f504805d36e8ebe1c2c5
aarch64: Move more code into aarch64_vector_costs

This patch moves more code into aarch64_vector_costs and reuses
some of the information that is now available in the base class.

I'm planing to significantly rework this code, with more hooks
into the vectoriser, but this seemed worth doing as a first step.

gcc/
* config/aarch64/aarch64.c (aarch64_vector_costs): Make member
variables private and add "m_" to their names.  Remove is_loop.
(aarch64_record_potential_advsimd_unrolling): Replace with...
(aarch64_vector_costs::record_potential_advsimd_unrolling): ...this.
(aarch64_analyze_loop_vinfo): Replace with...
(aarch64_vector_costs::analyze_loop_vinfo): ...this.
Move initialization of (m_)vec_flags to add_stmt_cost.
(aarch64_analyze_bb_vinfo): Delete.
(aarch64_count_ops): Replace with...
(aarch64_vector_costs::count_ops): ...this.
(aarch64_vector_costs::add_stmt_cost): Set m_vec_flags,
using m_costing_for_scalar to test whether we're costing
scalar or vector code.
(aarch64_adjust_body_cost_sve): Replace with...
(aarch64_vector_costs::adjust_body_cost_sve): ...this.
(aarch64_adjust_body_cost): Replace with...
(aarch64_vector_costs::adjust_body_cost): ...this.
(aarch64_vector_costs::finish_cost): Use m_vinfo instead of is_loop.
gcc/config/aarch64/aarch64.c