Landing: 5dee3c6521c2
Project / Subsystem
gcc / match
Date
2026-03-27
Author
Pengxuan Zheng
Commit
5dee3c6521c2787836c3925221d603a20ef0ae2c
Source
github
Perf win
Yes
Breaking
No
All attributes
- project
- gcc
- subsystem
- match
- patch_id
- —
- commit_hash
- 5dee3c6521c2787836c3925221d603a20ef0ae2c
- source_type
- github
- headline
- match: Simplify min|max(a+|-c,b+|-c) to min|max(a,b)+|-c
- tldr
- The compiler now simplifies `min|max(a+|-c,b+|-c)` to `min|max(a,b)+|-c`, potentially improving code efficiency.
- author
- Pengxuan Zheng
- outcome
- committed
- performance_win
- true
- breaking_change
- false
- series_id
- —
- series_parts
- []
- tags
-
- • optimization
- • pattern matching
- • algebraic simplification
- discussion_id_link
- —
- bugzilla_pr
- —
- date
- 2026-03-27T00:00:00.000Z
The compiler’s pattern matching infrastructure now simplifies expressions of the form min (a + c, b + c) to min (a, b) + c, and similarly for max and subtraction. This transformation can reduce the number of operations and improve code efficiency, especially in loops or other performance-critical sections. New test cases have been added to verify this simplification.