GCC Newspaper
OCTOBER 6, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
backthreader Performance Win

Backthreader optimization skips blocks with no inferred ranges.

Backthreader pass is faster by skipping blocks that have no inferred pointer ranges.

The backthreader pass in GCC has been optimized to improve performance. It now efficiently skips blocks that lack inferred pointer ranges, reducing unnecessary work. This change specifically targets adjust_for_non_null_uses by collecting pointer dependencies once per path and querying the inference oracle only when necessary, leading to a measurable speedup.

In Details

The backthreader::thread_blocks() function, specifically the path_range_query::adjust_for_non_null_uses method, has been optimized. Instead of iterating over all exit dependencies for every block in a path, it now uses a new member m_pointer_exit_dependencies to store and iterate over only pointer-related dependencies. This optimization also allows the pass to quickly skip blocks where no ranges can be inferred by populating m_pointer_exit_dependencies during compute_ranges, reducing redundant oracle queries and improving performance by 3.6% on the stage1 .ii corpus.

For Context
backthreader
A compiler pass in GCC that analyzes and optimizes code flow, potentially related to backward analysis or threading through control flow graphs.
inferred ranges
Information about the possible values or properties (e.g., pointer non-null status) of variables that the compiler deduces during analysis.
inference oracle
A component within the compiler that provides information or answers queries about code properties, such as data ranges or possible values.
control flow graph (CFG)
A representation of all execution paths in a program, used by compilers for analysis and optimization.
stage1 .ii corpus
A set of C source files preprocessed into '.ii' files, used for testing and profiling GCC during its initial compilation stage.
Filed Under: optimizationbackthreadergccperformance