Landing: 1a06a37611e3

Project / Subsystem

gcc / gcc

Date

2026-05-07

Author

Roger Sayle

Commit

1a06a37611e3b27889c595a17df13f6d27202a95

Source

github

Perf win

Yes

Breaking

No

All attributes

project
gcc
subsystem
gcc
patch_id
commit_hash
1a06a37611e3b27889c595a17df13f6d27202a95
source_type
github
headline
Improve RTL expansion of doubleword multiplications.
tldr
Improves RTL expansion of doubleword multiplications by handling shifts greater than BITS_PER_WORD and preventing generation of unnecessary multiplications.
author
Roger Sayle
outcome
committed
performance_win
true
breaking_change
false
series_id
series_parts
[]
tags
  • RTL expansion
  • doubleword multiplication
  • optimization
discussion_id_link
bugzilla_pr
date
2026-05-07T00:00:00.000Z

This commit improves RTL expansion of doubleword multiplications, specifically addressing cases where the constant being multiplied has BITS_PER_WORD or more trailing zeros. It teaches synth_mult that doubleword shifts by more than BITS_PER_WORD typically require two instructions. It also prevents RTL expansion from emitting multiply instructions by immediate constants 0, 1 or 2, speeding up compilation and reducing memory usage.