Landing: 9eb8a18033a4

Project / Subsystem

gcc / gcc

Date

2026-04-28

Author

Vladimir N. Makarov

Commit

9eb8a18033a473b30559862b3ff6a1cac162759b

Source

github

Perf win

Yes

Breaking

No

All attributes

project
gcc
subsystem
gcc
patch_id
commit_hash
9eb8a18033a473b30559862b3ff6a1cac162759b
source_type
github
headline
IRA: Fix implicit preference calculation for hard registers.
tldr
This patch corrects an issue in the IRA that could lead to suboptimal code generation by improving the hard register preference calculation.
author
Vladimir N. Makarov
outcome
committed
performance_win
true
breaking_change
false
series_id
series_parts
[]
tags
  • ira
  • register allocation
  • optimization
discussion_id_link
bugzilla_pr
date
2026-04-28T00:00:00.000Z

The IRA (Integrated Register Allocator) could ignore some valid register alternatives for subsequent operands when searching for preferred hard registers under strict constraints. This could result in suboptimal code generation because the allocator didn’t properly consider all options. This patch fixes the issue by ensuring that the same starting preference is used for all operands, leading to better register allocation decisions.