Landing: 3b126071b10e

Project / Subsystem

gcc / middle-end

Date

2026-07-23

Author

Odysseas Georgoudis

Commit

3b126071b10e5b12e7694f7a237f746e8db6d82c

Source

github

Perf win

Yes

Breaking

No

All attributes

project
gcc
subsystem
middle-end
patch_id
commit_hash
3b126071b10e5b12e7694f7a237f746e8db6d82c
source_type
github
headline
Fold averages with equal operands
tldr
Optimizes average calculations by folding identical operands into a direct result.
author
Odysseas Georgoudis
outcome
committed
performance_win
true
breaking_change
false
series_id
series_parts
[]
tags
  • optimization
  • middle-end
  • constant folding
discussion_id_link
bugzilla_pr
date
2026-07-23T00:00:00.000Z

The GCC middle-end now performs a constant folding optimization for average calculations where both operands are identical. Expressions like IFN_AVG_FLOOR(x, x) and IFN_AVG_CEIL(x, x) are now correctly simplified to just x, reducing redundant computations.