Optimize inferred range calculation in GIMPLE.
Improves GIMPLE's range_cache by leveraging edge calculation for inferred ranges, reducing redundant work.
This commit refactors the range_from_dom routine in GIMPLE’s range cache to be more efficient. Instead of performing separate walks for abnormal edges and inferred ranges, it now marks blocks with inferred ranges during the initial dominator tree traversal. The subsequent walk then integrates both inferred ranges and outgoing edge ranges, reducing overall computation and improving performance.
In Details
The ranger_cache::range_from_dom function previously performed separate, inefficient logic for handling abnormal edges and inferred ranges. This patch modifies the routine to mark blocks with inferred ranges during the initial dominator tree walk, similar to how outgoing edges are marked. A subsequent walk then calculates and integrates both types of ranges together. This optimization reduces redundant computations within the range caching mechanism, benefiting subsequent optimization passes.