Landing: 7f7bf8226594

Project / Subsystem

gcc / backthreader

Date

2026-09-07

Author

Aldy Hernandez

Commit

7f7bf82265941bce90c63a77aa5ab447fc4f1f90

Source

github

Perf win

Yes

Breaking

No

All attributes

project
gcc
subsystem
backthreader
patch_id
—
commit_hash
7f7bf82265941bce90c63a77aa5ab447fc4f1f90
source_type
github
headline
backthreader: use a BB flag for the visited-block set
tldr
Replaces hash set with a basic block flag for tracking visited blocks, improving performance.
author
Aldy Hernandez
outcome
committed
performance_win
true
breaking_change
false
series_id
—
series_parts
[]
tags
  • • performance
  • • analysis
discussion_id_link
—
bugzilla_pr
—
date
2026-09-07T00:00:00.000Z

The backwards threader pass in GCC previously used a hash_set<basic_block> to track visited blocks during path exploration. This incurred a hash lookup cost on entry and exit of each basic block. This commit replaces the hash set with a simple flag on the basic block itself, as the set’s usage is confined to the current function and the control flow graph doesn’t change. This change reduces overhead and simplifies the implementation.