]> git.ipfire.org Git - thirdparty/gcc.git/commit
RISC-V: Increase cost for vec_construct [PR118019].
authorRobin Dapp <rdapp@ventanamicro.com>
Fri, 13 Dec 2024 10:23:03 +0000 (11:23 +0100)
committerRobin Dapp <rdapp@ventanamicro.com>
Mon, 16 Dec 2024 14:25:27 +0000 (15:25 +0100)
commitce199a952bfef3e27354a4586a17bc55274c1d3c
treef53d1450495c916e0e2679be63e6da6d4bfc8aac
parentf1309dbc7c281dc9fd70db8ec6e8cb804b2089fc
RISC-V: Increase cost for vec_construct [PR118019].

For a generic vec_construct from scalar elements we need to load each
scalar element and move it over to a vector register.
Right now we only use a cost of 1 per element.

This patch uses register-move cost as well as scalar_to_vec and
multiplies it with the number of elements in the vector instead.

PR target/118019

gcc/ChangeLog:

* config/riscv/riscv.cc (riscv_builtin_vectorization_cost):
Increase vec_construct cost.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/rvv/autovec/pr118019.c: New test.
gcc/config/riscv/riscv.cc
gcc/testsuite/gcc.target/riscv/rvv/autovec/pr118019.c [new file with mode: 0644]