Landing: 0502e6b1e7be
Project / Subsystem
gcc / gcc/optimization
Date
2026-07-09
Author
Konstantinos Eleftheriou
Commit
0502e6b1e7be3d3fe00727e2936d3c3a03537c4e
Source
github
Perf win
Yes
Breaking
No
All attributes
- project
- gcc
- subsystem
- gcc/optimization
- patch_id
- —
- commit_hash
- 0502e6b1e7be3d3fe00727e2936d3c3a03537c4e
- source_type
- github
- headline
- match.pd, forwprop: Recognize long-multiply carries as 2-arg PHI
- tldr
- Improves long-multiply optimization by recognizing carry propagation in PHI nodes with specific base+pow2 patterns.
- author
- Konstantinos Eleftheriou
- outcome
- committed
- performance_win
- true
- breaking_change
- false
- series_id
- —
- series_parts
- []
- tags
-
- • gcc
- • optimization
- • forwprop
- • long-multiply
- • phi-node
- discussion_id_link
- —
- bugzilla_pr
- —
- date
- 2026-07-09T00:00:00.000Z
This commit enhances the forwprop (forward propagation) optimization pass to recognize and optimize long-multiply operations where the carry is expressed using a two-argument PHI node. This pattern, common in hand-written assembly, involves a PHI that conditionally adds a power of two. The pass now identifies these PHI structures and folds them into the long-multiply operation, improving the compiler’s ability to optimize these cases, particularly for the high part of the multiplication.