Landing: a20efc87806d

Project / Subsystem

gcc / match

Date

2026-05-06

Author

Eikansh Gupta

Commit

a20efc87806dd0f9f75a69a65547cce0e5e13e5b

Source

github

Perf win

Yes

Breaking

No

All attributes

project
gcc
subsystem
match
patch_id
commit_hash
a20efc87806dd0f9f75a69a65547cce0e5e13e5b
source_type
github
headline
Match: Simplify max/min of ANDed variables.
tldr
New match.pd patterns optimize min/max operations on variables ANDed with constants.
author
Eikansh Gupta
outcome
committed
performance_win
true
breaking_change
false
series_id
series_parts
[]
tags
  • optimization
  • pattern matching
  • tree-ssa
discussion_id_link
bugzilla_pr
date
2026-05-06T00:00:00.000Z

New patterns in match.pd recognize opportunities to simplify min/max operations where both operands involve the same variable ANDed with different constants. For signed types, the optimization is enabled when both constants share the same sign bit. New patterns also handle the specific case of min/max(a, a & CST), improving code generation for these common scenarios.