Landing: 8395fa7c79ee
Project / Subsystem
gcc / tree-optimization
Date
2026-07-01
Author
Philipp Tomsich
Commit
8395fa7c79eecf102b276ffee37436e75a522978
Source
github
Perf win
Yes
Breaking
No
All attributes
- project
- gcc
- subsystem
- tree-optimization
- patch_id
- —
- commit_hash
- 8395fa7c79eecf102b276ffee37436e75a522978
- source_type
- github
- headline
- VN finds inverse widening lookups for PLUS/MINUS
- tldr
- Value Numbering now recognizes (T)A + C == (T)(A + C) to improve optimization.
- author
- Philipp Tomsich
- outcome
- committed
- performance_win
- true
- breaking_change
- false
- series_id
- —
- series_parts
- []
- tags
-
- • optimization
- • compiler internals
- • VN
- discussion_id_link
- —
- bugzilla_pr
- —
- date
- 2026-07-01T00:00:00.000Z
This change enhances Value Numbering (VN) by adding an inverse widening lookup for PLUS and MINUS operations. Previously, VN could canonicalize expressions like (T)(A + C) to (T)A + (T)C, but not the reverse. By adding a pattern to rewrite (T)A +- CST into (T)(A +- CST’), VN can now discover equivalences regardless of the initial expression form, potentially leading to better constant folding and reduced miscompiles.