Landing: f8eb22d8408b

Project / Subsystem

gcc / match

Date

2026-07-17

Author

Neal Patalay

Commit

f8eb22d8408b25f337fad514aa8f47fe24f051d9

Source

github

Perf win

Yes

Breaking

No

All attributes

project
gcc
subsystem
match
patch_id
commit_hash
f8eb22d8408b25f337fad514aa8f47fe24f051d9
source_type
github
headline
match: Simplify sign tests for MIN and BIT_IOR
tldr
Optimizes comparisons involving MIN and bitwise OR operations by simplifying sign tests.
author
Neal Patalay
outcome
committed
performance_win
true
breaking_change
false
series_id
series_parts
[]
tags
  • optimization
  • compiler
discussion_id_link
bugzilla_pr
date
2026-07-17T00:00:00.000Z

The match.pd patterns now simplify comparisons against zero for MIN(a, b) and a | b when b is known to be non-negative. These operations’ signs then depend solely on ‘a’, allowing optimization of MIN (a, b) cmp 0 and (a | b) cmp 0 to a cmp 0. This optimization is now performed earlier in the compilation process.