Landing: fd1bc5303748

Project / Subsystem

gcc / match.pd

Date

2026-07-30

Author

Kyrylo Tkachov

Commit

fd1bc5303748a7b3b0a157a8688f3cb2af16abc6

Source

github

Perf win

Yes

Breaking

No

All attributes

project
gcc
subsystem
match.pd
patch_id
—
commit_hash
fd1bc5303748a7b3b0a157a8688f3cb2af16abc6
source_type
github
headline
match.pd: Add rule for masked OR comparisons.
tldr
Adds a new pattern matching rule for optimizing masked OR comparisons.
author
Kyrylo Tkachov
outcome
committed
performance_win
true
breaking_change
false
series_id
—
series_parts
[]
tags
  • • optimization
  • • match.pd
  • • pattern matching
  • • aarch64
discussion_id_link
—
bugzilla_pr
—
date
2026-07-30T00:00:00.000Z

This commit introduces a new optimization rule to GCC’s pattern matching system (match.pd) for simplifying masked OR comparisons. It addresses the dual of an existing rule: (X | C) == (Y | C) now folds to ((X ^ Y) & C) == 0. This optimization is demonstrated with an example of case-insensitive ASCII comparison, allowing for more efficient code generation on architectures like aarch64.