GCC Newspaper
OCTOBER 6, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
gcc/cselim

cselim: Skip store replacement for certain conditional stores

Fixes a regression in conditional store optimization that incorrectly reduced loop dependency counts.

This commit reverts a change in the cselim pass that affected conditional store optimizations. The previous change caused a regression in a libgomp test case by incorrectly reducing the number of loops carrying no dependency. The fix re-enables the previous behavior for certain conditional stores, ensuring correct analysis of loop dependencies.

In Details

The cond_if_else_store_replacement_limited optimization in cselim was too aggressive in factoring out stores in conditional branches. This commit adjusts the optimization to skip factoring when stores occur on both sides of an if-else, preventing a regression in loop dependency analysis seen in libgomp.graphite/force-parallel-8.c.

For Context
cselim
The conditional select elimination optimization pass in GCC, responsible for simplifying conditional assignments.
libgomp
GCC's OpenMP implementation, providing parallel execution support.
loop dependency
A situation where one iteration of a loop depends on the result of a previous iteration, affecting parallelization potential.
Filed Under: optimizationregressionlibgomp