Landing: 5b40e9d181bf
Project / Subsystem
gcc / forwprop
Date
2026-07-30
Author
Daniel Barboza
Commit
5b40e9d181bfe268ee9922c6af525bc5dab2604c
Source
github
Perf win
Yes
Breaking
No
All attributes
- project
- gcc
- subsystem
- forwprop
- patch_id
- —
- commit_hash
- 5b40e9d181bfe268ee9922c6af525bc5dab2604c
- source_type
- github
- headline
- Simplifies division and modulo by powers of two in PHI nodes.
- tldr
- New forward propagation pass simplifies DIV/MOD by powers of two into RSHIFT/BIT_AND within PHI nodes.
- author
- Daniel Barboza
- outcome
- committed
- performance_win
- true
- breaking_change
- false
- series_id
- —
- series_parts
- []
- tags
-
- • optimization
- • SSA
- • integer arithmetic
- discussion_id_link
- —
- bugzilla_pr
- —
- date
- 2026-07-30T00:00:00.000Z
A new forward propagation pass, simplify_phi_result_movdiv, is introduced to simplify division and modulo operations where the divisor is a power of two within PHI nodes. It transforms DIV into RSHIFT and MOD into BIT_AND, provided certain conditions on the operands are met. This change resolves most use cases for PR101179 by enabling these simplifications for positive power-of-two divisors and specific conditions on the PHI node’s arguments.