https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52252
--- Comment #11 from rguenther at suse dot de <rguenther at suse dot de> --- On Tue, 28 Nov 2023, pinskia at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52252 > > Andrew Pinski <pinskia at gcc dot gnu.org> changed: > > What |Removed |Added > ---------------------------------------------------------------------------- > CC| |pinskia at gcc dot gnu.org > > --- Comment #10 from Andrew Pinski <pinskia at gcc dot gnu.org> --- > Note there is also a missing scalar optimization here also (which will improve > the vectorized version in the end too). > > Right now we have the following match pattern: > /* MIN (~X, ~Y) -> ~MAX (X, Y) > MAX (~X, ~Y) -> ~MIN (X, Y) */ > (for minmax (min max) > maxmin (max min) > (simplify > (minmax (bit_not:s@2 @0) (bit_not:s@3 @1)) > (bit_not (maxmin @0 @1))) > > > But that does not match here due to the :s. I am not 100% sure but trading 2 > possible bit_not for adding another might end up improving things ... We're lacking a way to say one of the bit_not should be single-used, one multi-use would be OK and a fair trade-off - not sure if that would be enough here, of course. That would mena changing to a condition with single_use ().