Landing: 91cca3ac45e7

Project / Subsystem

gcc / gcc/optimization

Date

2026-07-08

Author

Konstantinos Eleftheriou

Commit

91cca3ac45e7f286e770536030da982d65615d4f

Source

github

Perf win

Yes

Breaking

No

All attributes

project
gcc
subsystem
gcc/optimization
patch_id
—
commit_hash
91cca3ac45e7f286e770536030da982d65615d4f
source_type
github
headline
forwprop: Add long-multiply ladder variants
tldr
Extends long-multiply optimization to recognize and fold 'ladder' variants involving shifted intermediate sums.
author
Konstantinos Eleftheriou
outcome
committed
performance_win
true
breaking_change
false
series_id
—
series_parts
[]
tags
  • • gcc
  • • optimization
  • • forwprop
  • • long-multiply
  • • ladder
discussion_id_link
—
bugzilla_pr
—
date
2026-07-08T00:00:00.000Z

This commit enhances the forwprop optimization pass by adding support for ‘ladder’ variants of long multiplication. These variants propagate carries through a series of mask, shift, and add operations on intermediate sums. The optimization now recognizes patterns like mul_ladder_sum1, mul_ladder_sum2, and mul_ladder_sum3, allowing the compiler to fold these complex multiplication sequences into more efficient code. This improves optimization for targets supporting these patterns and addresses a reported issue (PR tree-optimization/107090).