Re: Fold some equal to and not equal to patterns in match.pd

2015-07-24 Thread Richard Biener
On Fri, Jul 24, 2015 at 9:48 AM, Kai Tietz wrote: > 2015-07-24 7:54 GMT+02:00 Jeff Law : >> On 07/23/2015 10:33 AM, Segher Boessenkool wrote: >>> >>> On Thu, Jul 23, 2015 at 10:09:49AM -0600, Jeff Law wrote: It seems to me in these kind of cases that selection of the canonical form

Re: Fold some equal to and not equal to patterns in match.pd

2015-07-24 Thread Kai Tietz
2015-07-24 7:54 GMT+02:00 Jeff Law : > On 07/23/2015 10:33 AM, Segher Boessenkool wrote: >> >> On Thu, Jul 23, 2015 at 10:09:49AM -0600, Jeff Law wrote: >>> >>> It seems to me in these kind of cases that selection of the canonical >>> form should be driven by factors outside of which is better for

Re: Fold some equal to and not equal to patterns in match.pd

2015-07-23 Thread Jeff Law
On 07/23/2015 10:33 AM, Segher Boessenkool wrote: On Thu, Jul 23, 2015 at 10:09:49AM -0600, Jeff Law wrote: It seems to me in these kind of cases that selection of the canonical form should be driven by factors outside of which is better for a particular target. ie, which is simpler I agree.

Re: Fold some equal to and not equal to patterns in match.pd

2015-07-23 Thread Segher Boessenkool
On Thu, Jul 23, 2015 at 10:09:49AM -0600, Jeff Law wrote: > It seems to me in these kind of cases that selection of the canonical > form should be driven by factors outside of which is better for a > particular target. ie, which is simpler I agree. But neither form is simpler here, and we need

Re: Fold some equal to and not equal to patterns in match.pd

2015-07-23 Thread Jeff Law
On 07/21/2015 06:40 PM, Andrew Pinski wrote: On Tue, Jul 21, 2015 at 12:16 PM, Richard Biener wrote: On July 21, 2015 11:38:31 AM GMT+02:00, Jakub Jelinek wrote: On Tue, Jul 21, 2015 at 09:15:31AM +, Hurugalawadi, Naveen wrote: Please find attached the patch which performs following patt

Re: Fold some equal to and not equal to patterns in match.pd

2015-07-22 Thread Segher Boessenkool
On Tue, Jul 21, 2015 at 05:40:07PM -0700, Andrew Pinski wrote: > The biggest question now becomes which way is the canonical form for > gimple and we can decide to optimize it on the RTL level (combine) > instead if it produces better code in those cases. combine does not do instruction selection

Re: Fold some equal to and not equal to patterns in match.pd

2015-07-22 Thread Richard Biener
On Tue, Jul 21, 2015 at 11:15 AM, Hurugalawadi, Naveen wrote: > Hi, > > Please find attached the patch which performs following patterns folding > in match.pd:- > > a ==/!= a p+ b to b ==/!= 0. > a << N ==/!= 0 to a&(-1>>N) ==/!= 0. > a * N ==/!= 0 where N is a power of 2 to a & (-1< log2 of N. >

Re: Fold some equal to and not equal to patterns in match.pd

2015-07-22 Thread Richard Biener
On Wed, Jul 22, 2015 at 2:40 AM, Andrew Pinski wrote: > On Tue, Jul 21, 2015 at 12:16 PM, Richard Biener > wrote: >> On July 21, 2015 11:38:31 AM GMT+02:00, Jakub Jelinek >> wrote: >>>On Tue, Jul 21, 2015 at 09:15:31AM +, Hurugalawadi, Naveen wrote: Please find attached the patch which

Re: Fold some equal to and not equal to patterns in match.pd

2015-07-21 Thread Andrew Pinski
On Tue, Jul 21, 2015 at 12:16 PM, Richard Biener wrote: > On July 21, 2015 11:38:31 AM GMT+02:00, Jakub Jelinek > wrote: >>On Tue, Jul 21, 2015 at 09:15:31AM +, Hurugalawadi, Naveen wrote: >>> Please find attached the patch which performs following patterns >>folding >>> in match.pd:- >>> >>

Re: Fold some equal to and not equal to patterns in match.pd

2015-07-21 Thread Richard Biener
On July 21, 2015 11:38:31 AM GMT+02:00, Jakub Jelinek wrote: >On Tue, Jul 21, 2015 at 09:15:31AM +, Hurugalawadi, Naveen wrote: >> Please find attached the patch which performs following patterns >folding >> in match.pd:- >> >> a ==/!= a p+ b to b ==/!= 0. >> a << N ==/!= 0 to a&(-1>>N) ==/!=

Re: Fold some equal to and not equal to patterns in match.pd

2015-07-21 Thread Kyrill Tkachov
On 21/07/15 11:46, pins...@gmail.com wrote: On Jul 21, 2015, at 3:31 AM, Kyrill Tkachov wrote: On 21/07/15 10:26, pins...@gmail.com wrote: On Jul 21, 2015, at 2:15 AM, Hurugalawadi, Naveen wrote: Hi, Please find attached the patch which performs following patterns folding in matc

Re: Fold some equal to and not equal to patterns in match.pd

2015-07-21 Thread Kyrill Tkachov
On 21/07/15 11:46, pins...@gmail.com wrote: On Jul 21, 2015, at 3:31 AM, Kyrill Tkachov wrote: On 21/07/15 10:26, pins...@gmail.com wrote: On Jul 21, 2015, at 2:15 AM, Hurugalawadi, Naveen wrote: Hi, Please find attached the patch which performs following patterns folding in matc

Re: Fold some equal to and not equal to patterns in match.pd

2015-07-21 Thread pinskia
> On Jul 21, 2015, at 3:31 AM, Kyrill Tkachov wrote: > > >> On 21/07/15 10:26, pins...@gmail.com wrote: >> >> >> >>> On Jul 21, 2015, at 2:15 AM, Hurugalawadi, Naveen >>> wrote: >>> >>> Hi, >>> >>> Please find attached the patch which performs following patterns folding >>> in match.p

Re: Fold some equal to and not equal to patterns in match.pd

2015-07-21 Thread Kyrill Tkachov
On 21/07/15 10:26, pins...@gmail.com wrote: On Jul 21, 2015, at 2:15 AM, Hurugalawadi, Naveen wrote: Hi, Please find attached the patch which performs following patterns folding in match.pd:- a ==/!= a p+ b to b ==/!= 0. a << N ==/!= 0 to a&(-1>>N) ==/!= 0. a * N ==/!= 0 where N is a po

Re: Fold some equal to and not equal to patterns in match.pd

2015-07-21 Thread Jakub Jelinek
On Tue, Jul 21, 2015 at 09:15:31AM +, Hurugalawadi, Naveen wrote: > Please find attached the patch which performs following patterns folding > in match.pd:- > > a ==/!= a p+ b to b ==/!= 0. > a << N ==/!= 0 to a&(-1>>N) ==/!= 0. Not sure about this second one. Why do you think it is generall

Re: Fold some equal to and not equal to patterns in match.pd

2015-07-21 Thread pinskia
> On Jul 21, 2015, at 2:15 AM, Hurugalawadi, Naveen > wrote: > > Hi, > > Please find attached the patch which performs following patterns folding > in match.pd:- > > a ==/!= a p+ b to b ==/!= 0. > a << N ==/!= 0 to a&(-1>>N) ==/!= 0. > a * N ==/!= 0 where N is a power of 2 to a & (-1< log2