Re: [PATCH] match.pd: Implement missed optimization (~X | Y) ^ X -> ~(X & Y) [PR109986]

2023-07-26 Thread Drew Ross via Gcc-patches
Thanks for catching and fixing David and Andrew. Drew On Tue, Jul 25, 2023 at 5:59 PM Andrew Pinski wrote: > On Tue, Jul 25, 2023 at 1:54 PM Andrew Pinski wrote: > > > > On Tue, Jul 25, 2023 at 12:45 PM Jakub Jelinek via Gcc-patches > > wrote: > > > > > > On Tue, Jul 25, 2023 at 03:42:21PM

Re: [PATCH] match.pd: Implement missed optimization (~X | Y) ^ X -> ~(X & Y) [PR109986]

2023-07-25 Thread Andrew Pinski via Gcc-patches
On Tue, Jul 25, 2023 at 1:54 PM Andrew Pinski wrote: > > On Tue, Jul 25, 2023 at 12:45 PM Jakub Jelinek via Gcc-patches > wrote: > > > > On Tue, Jul 25, 2023 at 03:42:21PM -0400, David Edelsohn via Gcc-patches > > wrote: > > > Hi, Drew > > > > > > Thanks for addressing this missed optimization.

Re: [PATCH] match.pd: Implement missed optimization (~X | Y) ^ X -> ~(X & Y) [PR109986]

2023-07-25 Thread Andrew Pinski via Gcc-patches
On Tue, Jul 25, 2023 at 12:45 PM Jakub Jelinek via Gcc-patches wrote: > > On Tue, Jul 25, 2023 at 03:42:21PM -0400, David Edelsohn via Gcc-patches > wrote: > > Hi, Drew > > > > Thanks for addressing this missed optimization. > > > > The testcase includes an incorrect assumption: signed char,

Re: [PATCH] match.pd: Implement missed optimization (~X | Y) ^ X -> ~(X & Y) [PR109986]

2023-07-25 Thread Jakub Jelinek via Gcc-patches
On Tue, Jul 25, 2023 at 03:42:21PM -0400, David Edelsohn via Gcc-patches wrote: > Hi, Drew > > Thanks for addressing this missed optimization. > > The testcase includes an incorrect assumption: signed char, which > causes the testcase to fail on PowerPC. > > Should the testcase be updated to

Re: [PATCH] match.pd: Implement missed optimization (~X | Y) ^ X -> ~(X & Y) [PR109986]

2023-07-25 Thread David Edelsohn via Gcc-patches
Hi, Drew Thanks for addressing this missed optimization. The testcase includes an incorrect assumption: signed char, which causes the testcase to fail on PowerPC. Should the testcase be updated to specify signed char in the function signatures or should -fsigned-char be added to the command

Re: [PATCH] match.pd: Implement missed optimization (~X | Y) ^ X -> ~(X & Y) [PR109986]

2023-07-19 Thread Drew Ross via Gcc-patches
Trying to lower converts to operands through, for example, (for op (bit_ior bit_and bit_xor) (for rop (bit_xor bit_ior bit_and) (simplify (op:c (nop_convert (rop @0 @1)) @3) (op (rop (convert:type @0) (convert:type @1)) @3 (simplify (convert (bit_not @0)) (bit_not (convert:type

Re: [PATCH] match.pd: Implement missed optimization (~X | Y) ^ X -> ~(X & Y) [PR109986]

2023-07-11 Thread Richard Biener via Gcc-patches
On Tue, Jul 11, 2023 at 3:08 PM Jakub Jelinek wrote: > > On Thu, Jul 06, 2023 at 03:00:28PM +0200, Richard Biener via Gcc-patches > wrote: > > On Wed, Jul 5, 2023 at 3:42 PM Drew Ross via Gcc-patches > > wrote: > > > > > > Adds a simplification for (~X | Y) ^ X to be folded into ~(X & Y). >

Re: [PATCH] match.pd: Implement missed optimization (~X | Y) ^ X -> ~(X & Y) [PR109986]

2023-07-11 Thread Jakub Jelinek via Gcc-patches
On Thu, Jul 06, 2023 at 03:00:28PM +0200, Richard Biener via Gcc-patches wrote: > On Wed, Jul 5, 2023 at 3:42 PM Drew Ross via Gcc-patches > wrote: > > > > Adds a simplification for (~X | Y) ^ X to be folded into ~(X & Y). > > Tested successfully on x86_64 and x86 targets. > > > >

Re: [PATCH] match.pd: Implement missed optimization (~X | Y) ^ X -> ~(X & Y) [PR109986]

2023-07-06 Thread Jakub Jelinek via Gcc-patches
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

Re: [PATCH] match.pd: Implement missed optimization (~X | Y) ^ X -> ~(X & Y) [PR109986]

2023-07-06 Thread Richard Biener via Gcc-patches
On Wed, Jul 5, 2023 at 3:42 PM Drew Ross via Gcc-patches wrote: > > Adds a simplification for (~X | Y) ^ X to be folded into ~(X & Y). > Tested successfully on x86_64 and x86 targets. > > PR middle-end/109986 > > gcc/ChangeLog: > > * match.pd ((~X | Y) ^ X ->

[PATCH] match.pd: Implement missed optimization (~X | Y) ^ X -> ~(X & Y) [PR109986]

2023-07-05 Thread Drew Ross via Gcc-patches
Adds a simplification for (~X | Y) ^ X to be folded into ~(X & Y). Tested successfully on x86_64 and x86 targets. PR middle-end/109986 gcc/ChangeLog: * match.pd ((~X | Y) ^ X -> ~(X & Y)): New simplification. gcc/testsuite/ChangeLog: *