Rework relation recomputation in value-relation.cc
Value relation recomputation is refactored to separate it from the range search for better integration with the new frontier model.
This commit refactors the relation recomputation logic in value-relation.cc. Previously, this process was intertwined with the range_from_dom search. The new approach decouples recomputation, performing it after the frontier search completes. It efficiently checks immediate uses of the LHS operand and their containing statements to determine if relation recomputation is necessary and if the statement dominates the request block.
In Details
The dom_oracle::recomputed_relation function in value-relation.cc is reworked to align with the new frontier-based approach. Instead of being tightly coupled with range_from_dom, relation recomputation is now a post-frontier-search step. It inspects the immediate_use list of the LHS operand to find relevant statements, checking for dominance before attempting recomputation. This change simplifies the interaction between range analysis and relation tracking.
- value-relation
- A component within GCC's value range propagation (VRP) framework that tracks relationships between values, often used for optimization.
- dominance
- In control flow graphs, a block A dominates block B if every path from the entry node to B must go through A. This is crucial for reasoning about data flow and transformations.
- frontier search
- A search algorithm used in graph traversal, particularly in dominance algorithms, that explores nodes adjacent to the currently processed set.