Landing: 9d734bb468e7

Project / Subsystem

gcc / gcc/match.pd

Date

2026-09-13

Author

Dominic P

Commit

9d734bb468e714099fd56ee31676f9d88a5f7154

Source

github

Perf win

Yes

Breaking

No

All attributes

project
gcc
subsystem
gcc/match.pd
patch_id
—
commit_hash
9d734bb468e714099fd56ee31676f9d88a5f7154
source_type
github
headline
Complete branchless min/max folds in match.pd.
tldr
GCC's pattern matching now better optimizes branchless min/max operations, reducing instruction count.
author
Dominic P
outcome
committed
performance_win
true
breaking_change
false
series_id
gcc:match.pd: complete the branchless min and max folds
series_parts
[]
tags
  • • optimization
  • • gcc
  • • x86_64
discussion_id_link
—
bugzilla_pr
—
date
2026-09-13T00:00:00.000Z

This commit enhances GCC’s pattern matching capabilities by completing the folding of branchless minimum and maximum operations. New patterns handle cases like Y + MIN (X - Y, 0) and MIN (X + Y, Y) - Y, which can reduce instruction counts significantly, as seen in the x264 median-of-three predictor example.