diff options
author | Juzhe-Zhong <juzhe.zhong@rivai.ai> | 2024-01-15 20:00:14 +0800 |
---|---|---|
committer | Pan Li <pan2.li@intel.com> | 2024-01-15 21:13:33 +0800 |
commit | 7be87b7d2e330afd14a7cc028f64d88f80e12f40 (patch) | |
tree | da0b5e7b6185751c045adafabd45638e7ed5ae32 /libgfortran/io/io.h | |
parent | 405096f908e1ceb0d6a1b5420ded20ad85ddae9e (diff) | |
download | gcc-7be87b7d2e330afd14a7cc028f64d88f80e12f40.zip gcc-7be87b7d2e330afd14a7cc028f64d88f80e12f40.tar.gz gcc-7be87b7d2e330afd14a7cc028f64d88f80e12f40.tar.bz2 |
RISC-V: Fix regression (GCC-14 compare with GCC-13.2) of SHA256 from coremark-pro
This patch fixes -70% performance drop from GCC-13.2 to GCC-14 with -march=rv64gcv in real hardware.
The root cause is incorrect cost model cause inefficient vectorization which makes us performance drop significantly.
So this patch does:
1. Adjust vector to scalar cost by introducing v to scalar reg move.
2. Adjust vec_construct cost since we does spend NUNITS instructions to construct the vector.
Tested on both RV32/RV64 no regression, Rebase to the trunk and commit it as it is approved by Robin.
PR target/113247
gcc/ChangeLog:
* config/riscv/riscv-protos.h (struct regmove_vector_cost): Add vector to scalar regmove.
* config/riscv/riscv-vector-costs.cc (adjust_stmt_cost): Ditto.
* config/riscv/riscv.cc (riscv_builtin_vectorization_cost): Adjust vec_construct cost.
gcc/testsuite/ChangeLog:
* gcc.target/riscv/rvv/autovec/vls/reduc-19.c: Adapt test.
* gcc.target/riscv/rvv/autovec/vls/reduc-20.c: Ditto.
* gcc.target/riscv/rvv/autovec/vls/reduc-21.c: Ditto.
* gcc.dg/vect/costmodel/riscv/rvv/pr113247-1.c: New test.
* gcc.dg/vect/costmodel/riscv/rvv/pr113247-2.c: New test.
* gcc.dg/vect/costmodel/riscv/rvv/pr113247-3.c: New test.
* gcc.dg/vect/costmodel/riscv/rvv/pr113247-4.c: New test.
Diffstat (limited to 'libgfortran/io/io.h')
0 files changed, 0 insertions, 0 deletions