On 9/18/25 06:33, Zhongyao Chen wrote:
From: Zhongyao Chen <[email protected]>
The vectorizer's compute_estimated_lmul function could previously
return a bad value when the estimated lmul was larger than RVV_M8.
This is corrected to return RVV_M8, preventing a register spill.
The patch includes a new regression test for PR target/121910, based
on the x264 mc_chroma function. The test uses scan-tree-dump to
confirm that the compiler chooses the expected vector mode (RVVM1QI)
at -O3, verifying the fix.
gcc/ChangeLog:
* config/riscv/riscv-vector-costs.cc (compute_estimated_lmul):
Return RVV_M8 when estimated lmul is too large.
gcc/testsuite/ChangeLog:
* gcc.target/riscv/rvv/autovec/pr121910.c: New file.
Thanks. I changed the test to include stdint-gcc which is standard
practice for the risc-v testsuite and fixed a couple nits in the
ChangeLog. Pushed to the trunk.
Thanks!
jeff