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

Keep partial equivalences out of ordering relations

Improves value relation tracking by prioritizing normal relations over partial ones.

This commit enhances GCC’s value relation tracking by ensuring that normal relations are preferred over partial equivalences when both exist. Partial equivalences are now excluded from the path oracle and are not combined with normal relations during recording. This prevents spurious connections in the value graph and improves the accuracy of optimizations like Value Range Propagation (VRP).

In Details

This change modifies value-relation.cc to refine how partial equivalences are handled within the value relation tracking framework, particularly concerning the dom_oracle and path_oracle. It ensures that normal relations (e.g., VREL_EQ, VREL_LT) take precedence over partial equivalences (where equality is only known for a subset of values or conditions). Partial equivalences are no longer recorded in the path_oracle or merged with other relations, preventing them from incorrectly influencing alias analysis or other dataflow analyses that rely on the oracle.

For Context
Value Relation
Represents the relationship between values, such as equality, inequality, or ordering. Used in optimizations to track possible value ranges or equalities.
Partial Equivalence
A weaker form of equivalence where two values are known to be equal only under certain conditions or for a subset of their possible values.
dom_oracle
Part of GCC's value analysis framework that provides information about dominance relationships and value equivalences.
path_oracle
A component within GCC's value analysis that tracks relationships along paths in the control flow graph, often used for aliasing and pointer analysis.
Value Range Propagation (VRP)
An optimization pass that determines the possible range of values for variables and uses this information to simplify expressions or eliminate code.
Filed Under: optimizationvalue analysisgcc