Landing: 3ab219939244
Project / Subsystem
gcc / gcc/risc-v
Date
2026-07-16
Author
Jeff Law
Commit
3ab2199392445f2deb3855dcfe68ecf0fed8466d
Source
github
Perf win
Yes
Breaking
No
All attributes
- project
- gcc
- subsystem
- gcc/risc-v
- patch_id
- —
- commit_hash
- 3ab2199392445f2deb3855dcfe68ecf0fed8466d
- source_type
- github
- headline
- RISC-V: Improve costing for if-converted sequences
- tldr
- Adjusts RISC-V cstore instruction costing to better handle if-conversion and reduce unnecessary instructions.
- author
- Jeff Law
- outcome
- committed
- performance_win
- true
- breaking_change
- false
- series_id
- —
- series_parts
- []
- tags
-
- • risc-v
- • optimization
- • compiler internals
- discussion_id_link
- —
- bugzilla_pr
- —
- date
- 2026-07-16T00:00:00.000Z
This patch refines the cost model for RISC-V compare-and-store (cstore) operations, addressing suboptimal patterns that often lead to additional subregister copies, zero extensions, and move instructions. By modifying the cost routines, the compiler aims to improve the efficiency of sequences involving these operations, particularly when they are part of if-converted code. This change helps avoid missed optimization opportunities and reduces the generation of suboptimal instruction sequences.