Landing: 325d217fb123
Project / Subsystem
gcc / ext-dce
Date
2026-03-06
Author
Philipp Tomsich
Commit
325d217fb12396db32b56f3ffe24977642a584cb
Source
github
Perf win
Yes
Breaking
No
All attributes
- project
- gcc
- subsystem
- ext-dce
- patch_id
- —
- commit_hash
- 325d217fb12396db32b56f3ffe24977642a584cb
- source_type
- github
- headline
- ext-dce: Promote narrow operations to wider mode when extended bits are dead
- tldr
- The extended dead code elimination pass now promotes narrow operations to wider modes when extended bits are unused, which can enable better code generation on…
- author
- Philipp Tomsich
- outcome
- committed
- performance_win
- true
- breaking_change
- false
- series_id
- —
- series_parts
- []
- tags
-
- • optimization
- • dead code elimination
- • risc-v
- discussion_id_link
- —
- bugzilla_pr
- —
- date
- 2026-03-06T00:00:00.000Z
The extended dead code elimination (ext-dce) pass now promotes narrow operations (e.g., sign-extended addition) to wider modes when the extended bits are unused. This promotion enables the combine pass to recognize wider-mode operations, like DI-mode sequences, and form instructions such as sh1add, sh2add, and sh3add on RISC-V. This optimization is limited to chains of operations to avoid regressions on targets with free sign extension; single-instruction promotions are skipped.