Landing: ece564fdaa15

Project / Subsystem

gcc / match

Date

2026-06-03

Author

Eikansh Gupta

Commit

ece564fdaa15a0da008cedd881afcd3f0f4dbd5a

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
match
patch_id
—
commit_hash
ece564fdaa15a0da008cedd881afcd3f0f4dbd5a
source_type
github
headline
MATCH: Simplify zero/sign extension bit operations [PR122848]
tldr
MATCH patterns now simplify bitwise operations involving zero and sign extensions of the same value.
author
Eikansh Gupta
outcome
committed
performance_win
false
breaking_change
false
series_id
—
series_parts
[]
tags
  • • optimization
  • • MATCH
  • • extensions
discussion_id_link
—
bugzilla_pr
—
date
2026-06-03T00:00:00.000Z

The GCC MATCH (Machine Architecture Tree Transformation) system has gained new patterns to simplify bitwise operations on values that have undergone both zero and sign extensions. Specifically, it now folds (zero_extend & sign_extend) to yield the zero_extend result, and (zero_extend | sign_extend) to yield the sign_extend result. This optimization flattens redundant operations, potentially leading to more efficient machine code and has been validated with a new test case for PR122848.