https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122155

--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Andrew Pinski <[email protected]>:

https://gcc.gnu.org/g:b667503f0396cf1845c89b9e0f8bdf1068cd4437

commit r16-4257-gb667503f0396cf1845c89b9e0f8bdf1068cd4437
Author: Andrew Pinski <[email protected]>
Date:   Sat Oct 4 10:16:20 2025 -0700

    cselim: Don't create a phi node if the rhs side are the same [PR122155]

    This is a small compile time optimization where if commonalizing stores
    that have the same rhs, a phi node does not need to be created.
    This uses the same code as what was added for the `= {};` case.
    The reason why it is a compile time optimization is that Copy prop
    later on will do the same thing so not creating a new phi and a new
    ssa name will have a small compile time improvement.

    Bootstrapped and tested on x86_64-linux-gnu.

            PR tree-optimization/122155

    gcc/ChangeLog:

            * tree-ssa-phiopt.cc (cond_if_else_store_replacement_1): Don't
            create a phi if the 2 rhs are the same.

    gcc/testsuite/ChangeLog:

            * gcc.dg/tree-ssa/cselim-3.c: New test.

    Signed-off-by: Andrew Pinski <[email protected]>

Reply via email to