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

--- Comment #9 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #8)
> (In reply to Hongtao Liu from comment #7)
> >   vect__26.23_52 = MEM <const vector(2) float> [(float *)_65 + 4B];
> >   mask__32.25_56 = vect_R_max_y_lsm.24_19 < vect__26.23_52;
> >   vect__33.26_23 = .VCOND_MASK (mask__32.25_56, vect__26.23_52,
> > vect_R_max_y_lsm.24_19);
> >   _55 = BIT_FIELD_REF <vect__26.23_52, 32, 32>;
> >   _54 = BIT_FIELD_REF <vect__26.23_52, 32, 0>;
> >   _28 = R_min_y_lsm.12_30 > _54;
> >   _29 = _28 ? _54 : R_min_y_lsm.12_30;
> >   # DEBUG BEGIN_STMT
> >   # DEBUG BEGIN_STMT
> >   _36 = R_min_z_lsm.14_48 > _55;
> >   _37 = _36 ? _55 : R_min_z_lsm.14_48;
> > 
> > For the vectorizer part, looks like it failed to vectorize the min part
> > 
> >         min.y = p.y < min.y ? p.y : min.y;
> >         min.z = p.z < min.z ? p.z : min.z
> > 
> > into VCOND_MASK and caused extra vec_extract for p.y/p.z.
> > 
> > The multi usage of vect__26.23_52 at rtl stage eventually prevent combine to
> > fold off the zero_extension of v2sf->v4sf(vmovq).
> 
> Yes, that's due to the 4/2 split of the 6 large group.  BB SLP discovery is
> greedy with fallback of building a vector CTOR for unhandled parts.  It's
> unfortunately a bit difficult to find optimal heuristic that completes
> discovery in reasonable time.  I'll give it a second look to see if there's
> something obvious we can do.

OK, so I have a patch extending on some earlier work that ends up vectorizing
the two {x,y} pairs and with -msse4 produces

.L5:
        movq    (%rsi), %xmm2
        movq    %xmm3, %xmm0
        movq    %xmm4, %xmm7
        addq    $16, %rsi
        movq    %xmm2, %xmm1
        cmpltps %xmm1, %xmm0
        cmpltps %xmm7, %xmm1
        blendvps        %xmm0, %xmm2, %xmm3
        movaps  %xmm1, %xmm0
        movss   -8(%rsi), %xmm1
        blendvps        %xmm0, %xmm2, %xmm4
        movaps  %xmm1, %xmm0
        maxss   %xmm6, %xmm1
        minss   %xmm5, %xmm0
        movaps  %xmm1, %xmm6
        movaps  %xmm0, %xmm5
        cmpq    %rsi, %rdx
        jne     .L5

Reply via email to