]> git.ipfire.org Git - thirdparty/gcc.git/commit
RISC-V: Add gr2vr cost helper function
authorPan Li <pan2.li@intel.com>
Tue, 6 May 2025 08:42:16 +0000 (16:42 +0800)
committerPan Li <pan2.li@intel.com>
Tue, 6 May 2025 12:31:32 +0000 (20:31 +0800)
commit9e9eb78bf4b77a049be00fb9ab0047170f19c9ea
tree37e420624a70289d5788d9f344a23e81fbb99522
parent17c1602d5e7b237357b94808399a68ab77d42640
RISC-V: Add gr2vr cost helper function

After we introduced the --param=gpr2vr-cost option to set the cost
value of when operation act from gpr to vr, we would like to introduce
a new helper function to get the cost of gp2vr.  And then make sure
all reference to gr2vr should go this helper function.

The helper function will pick up the GR2VR value if the above option is
not provided, or the default GR2VR will be returned.

gcc/ChangeLog:

* config/riscv/riscv-protos.h (get_gr2vr_cost): Add new decl to
get the cost of gr2vr.
* config/riscv/riscv-vector-costs.cc (costs::adjust_stmt_cost):
Leverage the helper function to get the cost of gr2vr.
* config/riscv/riscv.cc (riscv_register_move_cost): Ditto.
(riscv_builtin_vectorization_cost): Ditto.
(get_gr2vr_cost): Add new impl of the helper function.

Signed-off-by: Pan Li <pan2.li@intel.com>
gcc/config/riscv/riscv-protos.h
gcc/config/riscv/riscv-vector-costs.cc
gcc/config/riscv/riscv.cc