On Thu, Jul 06, 2023 at 03:00:28PM +0200, Richard Biener via Gcc-patches wrote: > > + (if (types_match (type, @1)) > > + (bit_not (bit_and @1 (convert @0))) > > + (if (types_match (type, @0)) > > + (bit_not (bit_and (convert @1) @0)) > > + (convert (bit_not (bit_and @0 (convert @1))))))) > > You can elide the types_match checks and instead always emit > > (convert (bit_not (bit_and @0 (convert @1))) > > the conversions are elided when the types match.
If all types match, sure, any of the variants will be good. But if say @1 matches type and doesn't match @0, then (convert (bit_not (bit_and @0 (convert @1))) will result in 2 conversions instead of just 1. Of course, it could be alternatively solved by some other simplify that would reduce the number of conversions. Jakub