Landing: c95484e09b2a
Project / Subsystem
gcc / backthreader
Date
2026-09-10
Author
Aldy Hernandez
Commit
c95484e09b2a44966dff2c9d16d08cbdf217f8fe
Source
github
Perf win
Yes
Breaking
No
All attributes
- project
- gcc
- subsystem
- backthreader
- patch_id
- —
- commit_hash
- c95484e09b2a44966dff2c9d16d08cbdf217f8fe
- source_type
- github
- headline
- Backthreader skips candidate scan when no path can start it.
- tldr
- Optimizes the backthreader by skipping candidate scans if no registered paths start on the same edge, improving performance by up to 96.7% in some cases.
- author
- Aldy Hernandez
- outcome
- committed
- performance_win
- true
- breaking_change
- false
- series_id
- —
- series_parts
- []
- tags
-
- • optimization
- • performance
- discussion_id_link
- —
- bugzilla_pr
- —
- date
- 2026-09-10T00:00:00.000Z
The backthreader’s adjust_paths_after_duplication function previously performed a quadratic scan for candidate paths on every duplication. This commit optimizes this by maintaining a count of registered paths starting on each edge. If a count is one, it means no other paths start there, and the scan is skipped, significantly reducing runtime for code with many registered paths.