Landing: d382f953805c

Project / Subsystem

gcc / middle-end

Date

2026-09-25

Author

Roger Sayle

Commit

d382f953805cb06ae0fa396d451d3888322b23ae

Source

github

Perf win

Yes

Breaking

No

All attributes

project
gcc
subsystem
middle-end
patch_id
—
commit_hash
d382f953805cb06ae0fa396d451d3888322b23ae
source_type
github
headline
Middle-end: Optimize MUL_HIGHPART RTL
tldr
Adds new RTL simplifications for signed and unsigned high-part multiplication operations.
author
Roger Sayle
outcome
committed
performance_win
true
breaking_change
false
series_id
—
series_parts
[]
tags
  • • optimization
  • • middle-end
  • • RTL
  • • multiplication
discussion_id_link
—
bugzilla_pr
—
date
2026-09-25T00:00:00.000Z

This patch introduces new RTL simplifications for SMUL_HIGHPART and UMUL_HIGHPART. The compiler can now recognize that multiplying the high part of a product by zero or one results in zero. Additionally, it optimizes multiplication by powers of two by transforming them into logical or arithmetic right shifts, depending on whether the operation is signed or unsigned. These optimizations improve the efficiency of intermediate representations for multiplication operations.