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

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

https://gcc.gnu.org/g:035e2f6217cf68e2d702f2323a8ccb6163fb39e2

commit r17-5032-g035e2f6217cf68e2d702f2323a8ccb6163fb39e2
Author: Igor Shevlyakov <[email protected]>
Date:   Fri Oct 9 11:08:56 2026 -0600

    [PATCH] vect: Pass 1s, not an all-ones mask, to an unmasked inbranch clone
[PR127784]

    When vectorizable_simd_clone_call uses an inbranch SIMD clone for a call
    site that is not masked, it synthesizes an all-true mask.  For clones
    whose mask argument is a vector of the argument type (mask_mode ==
    VOIDmode) it built an all-ones mask of that type and then converted it
    to the clone's 1/0 encoding with

      VEC_COND_EXPR <mask, { 1, ... }, { 0, ... }>

    A VEC_COND_EXPR condition must be a boolean vector, but
    vect_build_all_ones_mask returns one only when the mask type is
    boolean; for a floating-point mask type it is a vector of NaNs, and the
    statement is invalid GIMPLE.  On x86_64 the SSE clone takes its mask as
    vector(2) double; since r17-2654 two calls of an "omp declare simd
    inbranch" function can be SLP-vectorized as one unmasked call of that
    clone, so this ICEs at -O2 -fopenmp-simd.

    All lanes are active, so pass the value the VEC_COND_EXPR would select,
    a vector of 1s, directly.

            PR tree-optimization/127784

    gcc/ChangeLog:

            * tree-vect-stmts.cc (vectorizable_simd_clone_call): Pass a vector
            of 1s as an all-true mask for a VOIDmode mask_mode.

    gcc/testsuite/ChangeLog:

            * gcc.dg/vect/vect-simd-clone-allones-mask.c: New test.

    Signed-off-by: Igor Shevlyakov <[email protected]>

Reply via email to