]> git.ipfire.org Git - thirdparty/gcc.git/commit
aarch64: Tweak the cost of elementwise stores
authorRichard Sandiford <richard.sandiford@arm.com>
Tue, 3 Aug 2021 12:00:46 +0000 (13:00 +0100)
committerRichard Sandiford <richard.sandiford@arm.com>
Tue, 3 Aug 2021 12:00:46 +0000 (13:00 +0100)
commit537afb0857c8f60c2b60a09fad4660420cd13e8f
tree0b4dbd4d9ccad0cb3f10c76b9f24f8bdd8dbf375
parent78770e0e5d9fef70679e1db4eb2fb06596fbb2f8
aarch64: Tweak the cost of elementwise stores

When the vectoriser scalarises a strided store, it counts one
scalar_store for each element plus one vec_to_scalar extraction
for each element.  However, extracting element 0 is free on AArch64,
so it should have zero cost.

I don't have a testcase that requires this for existing -mtune
options, but it becomes more important with a later patch.

gcc/
* config/aarch64/aarch64.c (aarch64_is_store_elt_extraction): New
function, split out from...
(aarch64_detect_vector_stmt_subtype): ...here.
(aarch64_add_stmt_cost): Treat extracting element 0 as free.
gcc/config/aarch64/aarch64.c