[PATCH] vect: Pass 1s, not an all-ones mask, to an unmasked inbranch clone [PR127784]
Jeff Law
jeffrey.law@oss.qualcomm.com
Fri Oct 9 17:08:39 GMT 2026
On 10/9/26 12:36 AM, Richard Biener wrote:
> On Thu, 8 Oct 2026, Igor Shevlyakov wrote:
>
>> 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.
> How did you test the patch?
>
> OK if bootstrapped/tested.
With Igor's followup indicating it'd been bootstrapped and regression
tested on x86, I've pushed this to the trunk.
jeff
More information about the Gcc-patches
mailing list