Segregate relation creation code.
Refactors relation creation and merging logic in GCC's value-relation component for better modularity.
GCC’s value-relation.cc has been refactored to separate the creation of relation records from the search and merge logic. A new function create_relation_record_in_bb handles record creation, while search_and_merge_relation manages finding existing records and merging, calling the creation function when necessary. This improves code organization and maintainability.
In Details
The set_one_relation function in value-relation.cc previously conflated creating a new relation record with searching for and merging existing ones. This commit splits these responsibilities into create_relation_in_bb and search_and_merge_relation. The latter now invokes the former when no existing relation is found or merged, leading to a cleaner separation of concerns within the dominator oracle's relation management.
- Relation Record
- A data structure used by GCC's value-relation analysis to store information about the relationships between values.
- Value-relation analysis
- A compiler analysis pass that determines the possible range of values for variables and expressions.
- Dominator Oracle
- A component within GCC that uses dominator tree information to efficiently query and manage relationships between program values.