Landing: 2d2e355b8936
Project / Subsystem
gcc / widening_mul
Date
2026-08-24
Author
Philipp Tomsich
Commit
2d2e355b89367711f549b1277a537e2c0a4de58d
Source
github
Perf win
Yes
Breaking
No
All attributes
- project
- gcc
- subsystem
- widening_mul
- patch_id
- —
- commit_hash
- 2d2e355b89367711f549b1277a537e2c0a4de58d
- source_type
- github
- headline
- Emit zero high-half partials for operands that fit in `widening_mul`.
- tldr
- Optimizes `widening_mul` by skipping unnecessary calculations for operands that fit within half the width.
- author
- Philipp Tomsich
- outcome
- committed
- performance_win
- true
- breaking_change
- false
- series_id
- —
- series_parts
- []
- tags
-
- • widening_mul
- • optimization
- • PR127042
- • tree-ssa
- discussion_id_link
- —
- bugzilla_pr
- —
- date
- 2026-08-24T00:00:00.000Z
The widening_mul optimization pass now correctly handles operands that provably fit within half the width of the multiplication. Previously, it performed unnecessary shift and multiply operations even when the high half of such operands was zero. This change reuses the recognizer’s ‘fits’ test to emit literal zeros for the high-half partial products, simplifying the generated code and improving efficiency.