DOM pass replaces test_for_singularity with simplify_using_ranges
Dominator analysis pass simplifies code by using a more capable range-based simplification function, removing redundant logic.
The Dominator analysis (DOM) pass in GCC has been updated to replace its internal test_for_singularity function with the more powerful simplify_using_ranges.
This change leverages existing range-based simplification capabilities to achieve the same goal, leading to slightly smarter code analysis. The update is part of an ongoing effort to refactor and improve the DOM pass.
In Details
The DOM pass in GCC's tree-ssa-dom.cc has removed the ad-hoc test_for_singularity and fold_cond logic. These have been replaced by calls to dom_opt_dom_walker::simplify_stmt, which utilizes simplify_using_ranges. This change aims to reduce code duplication and improve the simplification capabilities within the dominator analysis, contributing to the eventual removal of the DOM pass itself.
- Dominator analysis (DOM)
- A compiler analysis that determines the control flow graph (CFG) nodes that must be executed before a given node. It's crucial for optimizations that depend on program execution paths.
- tree-ssa-dom.cc
- The GCC source file containing the implementation of the dominator analysis pass, operating on the compiler's SSA (Static Single Assignment) intermediate representation.
- simplify_using_ranges
- A GCC optimization routine that simplifies expressions and code patterns by analyzing and manipulating ranges of values.
- SSA (Static Single Assignment)
- An intermediate representation form used by compilers where each variable is assigned a value exactly once. This simplifies many data-flow analyses and optimizations.