Dom: Optimize compile time by storing only switch case values.
The compiler now stores only the case value instead of the entire CASE_LABEL_EXPR for switch statements in the dominator tree, improving compile time.
The compiler’s dominator tree construction now stores only the value of switch case labels instead of the entire CASE_LABEL_EXPR. This reduces memory usage during compilation, which improves compile time. Comments were added to clarify the code.
In Details
During the conversion of gswitch away from CASE_LABEL_EXPR, record_edge_info in tree-ssa-dom.cc was found to be storing the entire CASE_LABEL_EXPR when only the case value is needed. This commit optimizes this by storing only the case's low value.
For Context
The dominator tree is a data structure used in compilers to represent the control flow of a program. Switch statements associate different code blocks with specific case values. This commit optimizes the representation of switch statements within the dominator tree, reducing memory usage and potentially improving compile times.