GCC Newspaper
JULY 29, 2026
Date
/
Architectures
Components
Topics
News & Policy
ifcvt Performance Win

ifcvt: Keep only reaching definitions when rewiring sets [PR126184]

ifcvt pass correctly handles multiple assignments to a variable, fixing a stale value bug.

The ifcvt optimization pass now correctly handles situations where a variable is assigned multiple times. Previously, it could incorrectly use a stale value from an earlier assignment when a later assignment should have taken precedence. This fix ensures that only the most recent, reaching definition is considered, correcting a data dependency bug and passing a new AArch64 test case.

In Details

In ifcvt.cc, the init_noce_multiple_sets_info function is modified to only record the most recent prior definition of a pseudo-register when processing multiple SET destinations. This addresses a PR126184 issue where the existing logic could lead to stale values being substituted due to incorrect replacement ordering, particularly in sequences with rewired SETs. An AArch64 testcase is added to verify the fix.

For Context
ifcvt
A GCC optimization pass that converts conditional backward branches into a sequence of conditional selection instructions where possible. This can improve performance by reducing control flow divergence.
pseudo-register
A temporary, virtual register used by the compiler during intermediate representation processing. They are distinct from hardware registers and are typically renamed and allocated to real registers later in the compilation pipeline.
RTL
Register Transfer Language, GCC's primary intermediate representation for machine instructions. It describes operations and data movement at a level close to the target architecture.
Filed Under: optimizationifcvtaarch64bugfix