GCC Newspaper
JUNE 15, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
niter Performance Win

Niter: Make MAX_DOMINATORS_TO_WALK configurable at runtime

The maximum number of dominators to walk in loop analysis can now be configured at runtime via a new `--param` option.

The MAX_DOMINATORS_TO_WALK limit, used in loop analysis passes like the niter pass, can now be configured at runtime, using the --param=max-niter-dominators-walk option. This allows users to increase the limit for very large function bodies where the default value may be insufficient. The previously hardcoded value is removed.

In Details

This commit introduces a new --param option to control the MAX_DOMINATORS_TO_WALK limit in tree-ssa-loop-niter.cc. This limit affects the number of dominators traversed during loop analysis. By making this configurable at runtime, users can adjust the limit for particularly large functions, avoiding potential analysis failures. The relevant functions determine_value_range, bound_difference and simplify_using_initial_conditions are updated.

For Context

Loop analysis is a crucial optimization phase in compilers. It helps to identify and transform loops for better performance. This commit makes a limit related to the analysis of complex loop structures user-configurable. When a function has a very complicated control flow, loop analysis might need to explore many possible execution paths. If the number of paths exceeds a predefined limit, the analysis might be incomplete or fail. This change allows users to increase this limit if needed, potentially enabling better optimization of large, complex functions.

Filed Under: optimizationloop analysisniterparameter