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

--- Comment #6 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Artemiy Volkov <[email protected]>:

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

commit r17-314-ga8b044785b091c96202b8228b4944be238879319
Author: Artemiy Volkov <[email protected]>
Date:   Tue Jan 20 11:53:50 2026 +0000

    forwprop: allow more VPEs in simplify_vector_constructor () [PR122679]

    Currently, simplify_vector_constructor () tries to rewrite a CONSTRUCTOR
    expression into a VEC_PERM_EXPR, as long as constructor elements all come
    from 1 or 2 source vectors.  While doing so, it protects against creating
    VEC_PERM_EXPRs unsupported by the target by calling can_vec_perm_const_p
    () before enacting the transformation and bailing when that returns false.

    However, we can instead allow those VEC_PERM_EXPRs to be created if we
    know that a later vector lowering pass will legitimize them for us.  IOW,
    only if the target doesn't support the resulting permute and the
    PROP_gimple_lvec property is already set, do we give up.  This patch
    inserts the required checks.

    This also allows us to remove the unnecessary vect_int requirement
    (wrongly added in r16-5244-g5a2319b71e4d30) from forwprop-43.c.

    (Re-)regtested on aarch64, arm, and x86_64.

            PR tree-optimization/122679

    gcc/ChangeLog:

            * tree-ssa-forwprop.cc (simplify_vector_constructor): Check the
            PROP_gimple_lvec property before returning false.

    gcc/testsuite/ChangeLog:

            * gcc.dg/tree-ssa/forwprop-43.c: Remove the vect_int check.

Reply via email to