FRIDAY, JUNE 26, 2026
gcc/tree-optimization Performance Win
Iterate PRE clean for cyclic value graphs
Fix PRE pass to handle cyclic value graphs by iterating.
The PRE (Partial Redundancy Elimination) optimization pass now iterates to correctly prune invalid expressions when encountering cyclic value graphs. This change addresses a specific test case exhibiting this cycle, ensuring more robust optimization.
In Details
The tree-ssa-pre.cc pass's clean function previously assumed acyclic value graphs. This commit introduces iteration to handle cases where ANTIC_IN values form a cycle, ensuring all invalid expressions are pruned. This is necessary for correctness when the SSA value graph contains cycles.
For Context
- PRE
- Partial Redundancy Elimination is a compiler optimization pass that eliminates redundant computations by identifying identical expressions whose values are computed multiple times.
- SSA
- Static Single Assignment is an intermediate representation form used in compilers where every variable is assigned exactly once. This simplifies many dataflow analyses and optimizations.
- ANTIC_IN
- In the context of SSA and PRE, this likely refers to a data structure or analysis that tracks incoming values to an 'anticipatable' expression, crucial for detecting redundancy.