Landing: 2aa3beeb892a
Project / Subsystem
gcc / risc-v
Date
2026-01-13
Author
Pan Li
Commit
2aa3beeb892ac38ca5a7ca9e3a25b0eaab567cd5
Source
github
Perf win
Yes
Breaking
No
All attributes
- project
- gcc
- subsystem
- risc-v
- patch_id
- —
- commit_hash
- 2aa3beeb892ac38ca5a7ca9e3a25b0eaab567cd5
- source_type
- github
- headline
- RISC-V: Combine vec_duplicate + vmsle.vv to vmsle.vx based on GR2VR cost
- tldr
- GCC now combines RISC-V ``vec_duplicate`` and ``vmsle.vv`` instructions into ``vmsle.vx`` when the cost of moving data to vector registers is low enough.
- author
- Pan Li
- outcome
- committed
- performance_win
- true
- breaking_change
- false
- series_id
- —
- series_parts
- []
- tags
-
- • risc-v
- • vectorization
- • rvv
- • optimization
- discussion_id_link
- —
- bugzilla_pr
- —
- date
- 2026-01-13T00:00:00.000Z
GCC now combines the vec_duplicate and vmsle.vv RISC-V vector instructions into a single vmsle.vx instruction when the cost of transferring data from general-purpose registers to vector registers (GR2VR) is sufficiently low (zero). This optimization reduces the number of instructions executed and improves performance. The compiler makes this decision based on the GR2VR cost, performing the late-combine optimization only when it’s beneficial.