aarch64: Add costs for one element of a scatter store
authorRichard Sandiford <richard.sandiford@arm.com>
Fri, 26 Mar 2021 16:08:32 +0000 (16:08 +0000)
committerRichard Sandiford <richard.sandiford@arm.com>
Fri, 26 Mar 2021 16:08:32 +0000 (16:08 +0000)
commit7c679969bac9b7ae5e9446bfaa5466e19063d690
tree667828ec4157edded0b696f774f07e9d2ad4a02c
parentd1ff0847b2df6ad21f77e26e7e516643c5aa7d40
aarch64: Add costs for one element of a scatter store

Currently each element in a gather load is costed as a scalar_load
and each element in a scatter store is costed as a scalar_store.
The load side seems to work pretty well in practice, since many
CPU-specific costs give loads quite a high cost relative to
arithmetic operations.  However, stores usually have a cost
of just 1, which means that scatters tend to appear too cheap.

This patch adds a separate cost for one element in a scatter store.

Like with the previous patches, 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::scatter_store_elt_cost): New member variable.
* config/aarch64/aarch64.c (generic_sve_vector_cost): Update
accordingly, taking the cost from the cost of a scalar_store.
(a64fx_sve_vector_cost): Likewise.
(aarch64_detect_vector_stmt_subtype): Detect scatter stores.
gcc/config/aarch64/aarch64-protos.h
gcc/config/aarch64/aarch64.c