Landing: 0d5fe4ed0540

Project / Subsystem

gcc / gcc/ivopts

Date

2026-08-29

Author

Jovan Dmitrovic

Commit

0d5fe4ed0540cca156754a905387c3420465b210

Source

github

Perf win

Yes

Breaking

No

All attributes

project
gcc
subsystem
gcc/ivopts
patch_id
—
commit_hash
0d5fe4ed0540cca156754a905387c3420465b210
source_type
github
headline
ivopts: Refine register pressure estimate for loop invariants
tldr
Register pressure estimation in loop invariant optimization is adjusted for more accurate spilling costs.
author
Jovan Dmitrovic
outcome
committed
performance_win
true
breaking_change
false
series_id
gcc:ivopts: adjust reg pressure estimate for spilling invariants compared to iv cands
series_parts
[]
tags
  • • optimization
  • • gcc
  • • loops
discussion_id_link
—
bugzilla_pr
—
date
2026-08-29T00:00:00.000Z

The ivopts pass has adjusted its register pressure estimation to more accurately reflect the cost of spilling loop invariants versus induction variables. Previously, it assumed spilling loop invariants was half the cost of spilling induction variables. This change corrects the calculation to account for the fact that invariants only need to be loaded once, while induction variables must be loaded and stored per loop iteration.