https://gcc.gnu.org/bugzilla/show_bug.cgi?id=128923
--- Comment #6 from Hongtao Liu <liuhongt at gcc dot gnu.org> ---
>
> and the mask operand ends up forced to a register:
>
> (reg:V2SI 134 [ mask__32.25_53 ])
>
> via expand_vec_cmp_expr and CODE_FOR_vec_cmpv2sfv2si - I suppose that
> naturally excludes having
>
> (gt:V2SI (reg:V2SF 111 [ vect__26.23 ])
> (reg:V2SF 115 [ vect__33.26 ]))
>
> there to match/combine during RTL expansion.
>
> IIRC we have some duplicates to this report but I also remember we fixed
> cases of vectorizing min/max with plain SSE?
x86 has ix86_expand_sse_fp_minmax at the expand stage, and *minmax<mode>3_{1-4}
at the combine stage to fold vec_cmp + vcond_mask into max/min where possible.
However, there are still some gaps when expand generates too many instructions
without SSE4.1 for vcond_mask, causing combine to fail since it currently
handles at most 4 instructions.
I'm working on a patch for that.