Landing: 6d9758128603

Project / Subsystem

gcc / ivopts

Date

2026-07-09

Author

Jovan Dmitrovic

Commit

6d97581286030449420dc4ee79612dd256067e2c

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
ivopts
patch_id
commit_hash
6d97581286030449420dc4ee79612dd256067e2c
source_type
github
headline
ivopts: Zero register pressure cost when registers are abundant
tldr
Loop invariant optimization pass now reports zero register pressure cost if ample registers exist, avoiding unnecessary spilling.
author
Jovan Dmitrovic
outcome
committed
performance_win
false
breaking_change
false
series_id
series_parts
[]
tags
  • optimization
  • ivopts
  • register allocation
discussion_id_link
bugzilla_pr
date
2026-07-09T00:00:00.000Z

The ivopts_estimate_reg_pressure function within GCC’s loop invariant optimization pass now correctly returns zero when sufficient registers are available. This prevents the pass from incorrectly estimating high register pressure and potentially causing unnecessary register spilling, which occurs when the compiler believes it doesn’t have enough registers to hold all temporary values.