Landing: d15703b27aa4
Project / Subsystem
gcc / risc-v
Date
2026-07-07
Author
wangjue
Commit
d15703b27aa4924ca3438066ae0759e7379b3e0b
Source
github
Perf win
Yes
Breaking
No
All attributes
- project
- gcc
- subsystem
- risc-v
- patch_id
- —
- commit_hash
- d15703b27aa4924ca3438066ae0759e7379b3e0b
- source_type
- github
- headline
- RISC-V adds small loop unrolling support
- tldr
- New -munroll-only-small-loops option provides conservative loop unrolling for RISC-V, balancing performance gains with code size.
- author
- wangjue
- outcome
- committed
- performance_win
- true
- breaking_change
- false
- series_id
- —
- series_parts
- []
- tags
-
- • risc-v
- • optimization
- • loops
- discussion_id_link
- —
- bugzilla_pr
- —
- date
- 2026-07-07T00:00:00.000Z
A new option, -munroll-only-small-loops, has been introduced for the RISC-V backend to enable conservative loop unrolling. This feature selectively unrolls small loops based on instruction thresholds to improve performance without significantly increasing code size or cache misses. It is enabled by default at -O2 and above, mirroring behavior on i386, and can be overridden by explicit unrolling flags. Existing tests not focused on unrolling are adjusted to maintain their original behavior.