Improve equiv_oracle::clear performance
Optimizes equiv_oracle::clear by tracking basic blocks with equivalences.
The equiv_oracle::clear method’s performance is enhanced by introducing a mechanism to track basic blocks containing equivalences for SSA names. Instead of re-processing all blocks, clear now focuses only on the necessary blocks, improving efficiency for equivalence tracking during optimization passes. This change is related to PR tree-optimization/126856.
In Details
The equiv_oracle::clear function is optimized by replacing a full traversal with a targeted approach. It now uses a new equiv_oracle::register_equiv_block function to record which basic blocks are affected by equivalences. The clear method then processes only these recorded blocks, improving performance for equivalence management in the compiler's optimization pipeline, addressing PR tree-optimization/126856.
- SSA name
- Static Single Assignment form. In SSA, each variable is assigned a unique name the first time it is defined. This simplifies many compiler optimizations.
- equiv_oracle
- A component within the compiler that manages and tracks equivalence relationships between variables or expressions, typically during optimization.
- basic block
- A sequence of instructions with a single entry point and a single exit point, used as a fundamental unit in control flow analysis.
- optimization passes
- Sequential stages in a compiler that analyze and transform intermediate representation code to improve its performance or size.