aarch64: Implement determine_suggested_unroll_factor
authorAndre Vieira <andre.simoesdiasvieira@arm.com>
Thu, 31 Mar 2022 16:08:59 +0000 (17:08 +0100)
committerAndre Vieira <andre.simoesdiasvieira@arm.com>
Thu, 31 Mar 2022 16:11:32 +0000 (17:11 +0100)
commit40d643d8de7bb0b7bd75e35f4274beb9793bb0df
treea51587381a9c70118164f93e570412d813709a53
parent7ea3a73c195a79e6740ae594ee1a14c8bf7a938d
aarch64: Implement determine_suggested_unroll_factor

This patch implements the costing function determine_suggested_unroll_factor
for aarch64.
It determines the unrolling factor by dividing the number of X operations we
can do per cycle by the number of X operations, taking this information from
the vec_ops analysis during vector costing and the available issue_info
information.
We multiply the dividend by a potential reduction_latency, to improve our
pipeline utilization if we are stalled waiting on a particular reduction
operation.

gcc/ChangeLog:

* config/aarch64/aarch64.cc (aarch64_vector_costs): Define
determine_suggested_unroll_factor and m_has_avg.
(determine_suggested_unroll_factor): New function.
(aarch64_vector_costs::add_stmt_cost): Check for a qualifying pattern
to set m_nosve_pattern.
(aarch64_vector_costs::finish_costs): Use
determine_suggested_unroll_factor.
* config/aarch64/aarch64.opt (aarch64-vect-unroll-limit): New.
* doc/invoke.texi: (aarch64-vect-unroll-limit): Document new option.
gcc/config/aarch64/aarch64.cc
gcc/config/aarch64/aarch64.opt
gcc/doc/invoke.texi