Re: [PATCH] match.pd: Add bitwise and pattern [PR106243]

2022-08-04 Thread Michael Matz via Gcc-patches
Hello, On Wed, 3 Aug 2022, Jeff Law via Gcc-patches wrote: > > .optimized dump shows: > >_1 = ABS_EXPR ; > >_3 = _1 & 1; > >return _3; > > > > altho combine simplifies it to x & 1 on RTL, resulting in code-gen: > > f1: > > and w0, w0, 1 > > ret > Doesn't the

Re: [PATCH] match.pd: Add bitwise and pattern [PR106243]

2022-08-04 Thread Richard Biener via Gcc-patches
On Thu, Aug 4, 2022 at 12:40 AM Jeff Law via Gcc-patches wrote: > > > > On 8/3/2022 2:44 PM, Prathamesh Kulkarni via Gcc-patches wrote: > > On Thu, 4 Aug 2022 at 00:41, Sam Feifer via Gcc-patches > > wrote: > >> This patch adds a new optimization to match.pd. The pattern, -x & 1, > >> now gets

Re: [PATCH] match.pd: Add bitwise and pattern [PR106243]

2022-08-04 Thread Richard Biener via Gcc-patches
On Wed, Aug 3, 2022 at 9:11 PM Sam Feifer via Gcc-patches wrote: > > This patch adds a new optimization to match.pd. The pattern, -x & 1, > now gets simplified to x & 1, reducing the number of instructions > produced. > > This patch also adds tests for the optimization rule. > >

Re: [PATCH] match.pd: Add bitwise and pattern [PR106243]

2022-08-03 Thread Jeff Law via Gcc-patches
On 8/3/2022 2:44 PM, Prathamesh Kulkarni via Gcc-patches wrote: On Thu, 4 Aug 2022 at 00:41, Sam Feifer via Gcc-patches wrote: This patch adds a new optimization to match.pd. The pattern, -x & 1, now gets simplified to x & 1, reducing the number of instructions produced. Hi Sam, No

Re: [PATCH] match.pd: Add bitwise and pattern [PR106243]

2022-08-03 Thread Prathamesh Kulkarni via Gcc-patches
On Thu, 4 Aug 2022 at 00:41, Sam Feifer via Gcc-patches wrote: > > This patch adds a new optimization to match.pd. The pattern, -x & 1, > now gets simplified to x & 1, reducing the number of instructions > produced. Hi Sam, No comments on patch, but wondering if we can similarly add another

[PATCH] match.pd: Add bitwise and pattern [PR106243]

2022-08-03 Thread Sam Feifer via Gcc-patches
This patch adds a new optimization to match.pd. The pattern, -x & 1, now gets simplified to x & 1, reducing the number of instructions produced. This patch also adds tests for the optimization rule. Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? PR tree-optimization/106243