Landing: 65814ca6027f

Project / Subsystem

gcc / forwprop

Date

2026-08-22

Author

Andrea Pinski

Commit

65814ca6027f373806edd21b0125f87359ebdcf2

Source

github

Perf win

Yes

Breaking

No

All attributes

project
gcc
subsystem
forwprop
patch_id
—
commit_hash
65814ca6027f373806edd21b0125f87359ebdcf2
source_type
github
headline
forwprop: Optimize `match_long_mul_phi` by reordering conditional checks.
tldr
forwprop: Reorders checks in `match_long_mul_phi` to prioritize cheaper conditions, improving performance.
author
Andrea Pinski
outcome
committed
performance_win
true
breaking_change
false
series_id
—
series_parts
[]
tags
  • • optimization
  • • compiler
discussion_id_link
—
bugzilla_pr
—
date
2026-08-22T00:00:00.000Z

In tree-ssa-forwprop.cc, the match_long_mul_phi function has been updated to reorder its conditional checks. The check for the shift amount equality (shift_amt == halfwidth) is now performed before the more computationally expensive gimple_mul_low_sum and gimple_mul_cross_sum calls. This optimization can lead to faster compilation by avoiding unnecessary function calls when the shift amount condition is not met.