Landing: 0c6332c9fff5
Project / Subsystem
gcc / match-sat-alu.pd
Date
2026-07-30
Author
Kyrylo Tkachov
Commit
0c6332c9fff5a0cb3dcf541e2b0f9c82c61ea182
Source
github
Perf win
Yes
Breaking
No
All attributes
- project
- gcc
- subsystem
- match-sat-alu.pd
- patch_id
- —
- commit_hash
- 0c6332c9fff5a0cb3dcf541e2b0f9c82c61ea182
- source_type
- github
- headline
- match-sat-alu.pd: Recognize signed saturation clamps
- tldr
- GCC now optimizes signed saturating additions and subtractions that involve clamping a wider intermediate result.
- author
- Kyrylo Tkachov
- outcome
- committed
- performance_win
- true
- breaking_change
- false
- series_id
- —
- series_parts
- []
- tags
-
- • optimization
- • gcc
- • aarch64
- discussion_id_link
- —
- bugzilla_pr
- —
- date
- 2026-07-30T00:00:00.000Z
GCC’s match-sat-alu.pd pattern matcher has been updated to recognize signed saturating addition and subtraction operations where a wider intermediate result is clamped to the bounds of the final result type. This optimization handles both orders of MIN and MAX operations and allows for direct replacement with instructions like SQADD on AArch64, significantly simplifying code generation.