GCC Newspaper
OCTOBER 6, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
vrp

VRP: Fold LE or GE tests between names into equality checks.

VRP pass now folds LE/GE comparisons between two variables into equality when possible.

The Value Range Propagation (VRP) pass can now fold less-than-or-equal (LE) or greater-than-or-equal (GE) tests between two variables into an equality test. This occurs when the relation oracle implies that if x <= y, then x must equal y, or similarly if x >= y. This change improves intermediate representation simplification by moving this logic from DOM to the simplifier.

In Details

The VRP pass in GCC's tree-ssa infrastructure now folds x <= y to x == y when the relation oracle implies VREL_GE, and x >= y to x == y when VREL_LE is implied. This optimization, previously handled by DOM, is now placed in the simplifier for IL rewriting passes, with a follow-up to replace DOM's existing logic with a simplify_using_ranges call.

For Context
VRP
Value Range Propagation. A compiler optimization pass that analyzes and narrows down the possible range of values for variables to enable further optimizations.
tree-ssa
The SSA (Static Single Assignment) form used within GCC's intermediate representation. It's represented using GCC's tree data structures.
relation oracle
A component within GCC's optimization passes that tracks relationships between variables and values, such as equality, inequality, or ordering.
IL
Intermediate Language. A representation of the program between the source code and the target machine code, used by compilers for analysis and optimization.
DOM
Dominator Tree. A tree structure representing the control flow graph of a program, used in various optimization passes. This commit moves some logic out of DOM.
Filed Under: optimizationcompiler