https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126789
--- Comment #9 from Hongtao Liu <liuhongt at gcc dot gnu.org> ---
>
> not sure why we chose
>
> movabsq $4294967297, %rax
> vmovq %rax, %xmm0
> vpand %xmm1, %xmm0, %xmm0
>
> here over
>
> vpsrld $31, %xmm0, %xmm0
>
> it's both from a .VCOND_MASK (mask, {1, 1}, {0, 0}) expansion. With
> AVX2 we'll get earlier folding to & { 1, 1, 1, 1 } though.
I guess some const_vector is forced to constant pool in ix86_expand_sse_movcc
and then be optimized by the tune "prefer_bcst_from_integer", calling
ix86_expand_vector_init for CONST_VECTOR_P should fix it.