Landing: f6103f3a1e42

Project / Subsystem

gcc / gcc/internals

Date

2026-06-04

Author

Kevin Stefanov

Commit

f6103f3a1e42fe4db15f3c1d96847cd4a4829e4e

Source

github

Perf win

Yes

Breaking

No

All attributes

project
gcc
subsystem
gcc/internals
patch_id
commit_hash
f6103f3a1e42fe4db15f3c1d96847cd4a4829e4e
source_type
github
headline
GCC optimizes hard register set iteration by replacing `TEST_HARD_REG_BIT`.
tldr
GCC improves the efficiency of iterating over hard register sets by replacing `TEST_HARD_REG_BIT` with `hard_reg_set_iterator` and `hard_reg_set_popcount`.
author
Kevin Stefanov
outcome
committed
performance_win
true
breaking_change
false
series_id
series_parts
[]
tags
  • optimization
  • register allocation
  • compiler internals
discussion_id_link
bugzilla_pr
date
2026-06-04T00:00:00.000Z

This GCC commit refactors internal loops that check individual bits in hard register sets, replacing inefficient TEST_HARD_REG_BIT calls within loops with the more efficient EXECUTE_IF_SET_IN_HARD_REG_SET macro. Additionally, direct calls to hard_reg_set_size are replaced with hard_reg_set_popcount, as the latter more accurately reflects the intended operation of counting set bits. These changes improve compiler performance by streamlining register set manipulations, primarily in architecture-specific code generation and optimization passes.