Landing: 6833708b4eaf

Project / Subsystem

gcc / match-sat-alu.pd

Date

2026-07-30

Author

Kyrylo Tkachov

Commit

6833708b4eaf3ce1c22313bc173ff4253becc86b

Source

github

Perf win

Yes

Breaking

No

All attributes

project
gcc
subsystem
match-sat-alu.pd
patch_id
—
commit_hash
6833708b4eaf3ce1c22313bc173ff4253becc86b
source_type
github
headline
match-sat-alu.pd: Recognize strict widened unsigned saturation clamps
tldr
GCC optimizes unsigned saturating additions where the clamp uses a strict inequality.
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 now recognizes unsigned saturating additions where the clamping condition uses a strict inequality (< MAX instead of <= MAX). This strict form is equivalent to clamping at MAX - 1 and is now correctly handled, enabling more efficient code generation. An AArch64 example shows a simplification from multiple instructions to a single csinv with a condition code.