Landing: 298071eb7e88

Project / Subsystem

gcc / middle-end

Date

2026-06-12

Author

liuhongt

Commit

298071eb7e88b01adc6a88f9eba797edaedec170

Source

github

Perf win

Yes

Breaking

No

All attributes

project
gcc
subsystem
middle-end
patch_id
—
commit_hash
298071eb7e88b01adc6a88f9eba797edaedec170
source_type
github
headline
Expand divisions with near-power-of-two divisors
tldr
Divisions by divisors near powers of two are now expanded using conditional moves for potential speedups.
author
liuhongt
outcome
committed
performance_win
true
breaking_change
false
series_id
—
series_parts
[]
tags
  • • optimization
  • • risc-v
discussion_id_link
—
bugzilla_pr
—
date
2026-06-12T00:00:00.000Z

GCC can now expand division operations where the divisor is proven to be close to a power of two. The compiler replaces a single division with two constant divisions selected by a conditional move. This optimization is applied only when it is determined to be faster than the original division, and when conditional move instructions are available on the target architecture.