-
- Downloads
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.
Showing
- gcc/config/riscv/riscv-protos.h 2 additions, 0 deletionsgcc/config/riscv/riscv-protos.h
- gcc/config/riscv/riscv-vector-costs.cc 3 additions, 0 deletionsgcc/config/riscv/riscv-vector-costs.cc
- gcc/config/riscv/riscv.cc 3 additions, 1 deletiongcc/config/riscv/riscv.cc
- gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/pr113247-1.c 195 additions, 0 deletionsgcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/pr113247-1.c
- gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/pr113247-2.c 6 additions, 0 deletionsgcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/pr113247-2.c
- gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/pr113247-3.c 6 additions, 0 deletionsgcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/pr113247-3.c
- gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/pr113247-4.c 6 additions, 0 deletionsgcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/pr113247-4.c
- gcc/testsuite/gcc.target/riscv/rvv/autovec/vls/reduc-19.c 1 addition, 1 deletiongcc/testsuite/gcc.target/riscv/rvv/autovec/vls/reduc-19.c
- gcc/testsuite/gcc.target/riscv/rvv/autovec/vls/reduc-20.c 1 addition, 1 deletiongcc/testsuite/gcc.target/riscv/rvv/autovec/vls/reduc-20.c
- gcc/testsuite/gcc.target/riscv/rvv/autovec/vls/reduc-21.c 1 addition, 1 deletiongcc/testsuite/gcc.target/riscv/rvv/autovec/vls/reduc-21.c
Loading
Please register or sign in to comment