aarch64: Add vector costs for SVE CLAST[AB] and FADDA
authorRichard Sandiford <richard.sandiford@arm.com>
Fri, 26 Mar 2021 16:08:30 +0000 (16:08 +0000)
committerRichard Sandiford <richard.sandiford@arm.com>
Fri, 26 Mar 2021 16:08:30 +0000 (16:08 +0000)
commit1282988ba15337f21a940cd5d1c0b34a62378a2f
treefebb0bfa72bc81fd50d2b34b7761ceb27ecbad7d
parente253bb8b796dbf88a2650e350a040cd0e0df41cd
aarch64: Add vector costs for SVE CLAST[AB] and FADDA

Following on from the previous reduction costs patch, this one
adds costs for the SVE CLAST[AB] and FADDA instructions.
These instructions occur within the loop body, whereas the
reductions handled by the previous patch occur outside.

Like with the previous patch, this one only becomes active if
a CPU selects use_new_vector_costs.  It should therefore have
a very low impact on other CPUs.

gcc/
* config/aarch64/aarch64-protos.h (sve_vec_cost): Turn into a
derived class of simd_vec_cost.  Add information about CLAST[AB]
and FADDA instructions.
* config/aarch64/aarch64.c (generic_sve_vector_cost): Update
accordingly, using the vec_to_scalar costs for the new fields.
(a64fx_sve_vector_cost): Likewise.
(aarch64_reduc_type): New function.
(aarch64_sve_in_loop_reduction_latency): Likewise.
(aarch64_detect_vector_stmt_subtype): Take a vinfo parameter.
Use aarch64_sve_in_loop_reduction_latency to handle SVE reductions
that occur in the loop body.
(aarch64_add_stmt_cost): Update call accordingly.
gcc/config/aarch64/aarch64-protos.h
gcc/config/aarch64/aarch64.c