Re: [PATCH][11/n] Merge from match-and-simplify, bit patterns from forwprop

2014-11-08 Thread H.J. Lu
On Thu, Nov 6, 2014 at 12:55 AM, Richard Biener wrote: > > This merges patterns implementing the bitwise patterns from > tree-ssa-forwprop.c. I've removed duplicate functionality from > fold-const.c as I found them, some may be still lurking in the > depths. > > This also fixes a bug in genmatch

Re: [PATCH][11/n] Merge from match-and-simplify, bit patterns from forwprop

2014-11-06 Thread Marc Glisse
On Thu, 6 Nov 2014, Richard Biener wrote: On Thu, 6 Nov 2014, Marc Glisse wrote: On Thu, 6 Nov 2014, Richard Biener wrote: On Thu, 6 Nov 2014, Marc Glisse wrote: On Thu, 6 Nov 2014, Richard Biener wrote: +/* Try simple folding for X op !X, and X op X with the help + of the truth_valued

Re: [PATCH][11/n] Merge from match-and-simplify, bit patterns from forwprop

2014-11-06 Thread Richard Biener
On Thu, 6 Nov 2014, Marc Glisse wrote: > On Thu, 6 Nov 2014, Richard Biener wrote: > > > On Thu, 6 Nov 2014, Marc Glisse wrote: > > > > > On Thu, 6 Nov 2014, Richard Biener wrote: > > > > > > > +/* Try simple folding for X op !X, and X op X with the help > > > > + of the truth_valued_p and lo

Re: [PATCH][11/n] Merge from match-and-simplify, bit patterns from forwprop

2014-11-06 Thread Marc Glisse
On Thu, 6 Nov 2014, Richard Biener wrote: On Thu, 6 Nov 2014, Marc Glisse wrote: On Thu, 6 Nov 2014, Richard Biener wrote: +/* Try simple folding for X op !X, and X op X with the help + of the truth_valued_p and logical_inverted_value predicates. */ +(match truth_valued_p + @0 + (if (INTE

Re: [PATCH][11/n] Merge from match-and-simplify, bit patterns from forwprop

2014-11-06 Thread Richard Biener
On Thu, 6 Nov 2014, Marc Glisse wrote: > On Thu, 6 Nov 2014, Richard Biener wrote: > > > +/* Try simple folding for X op !X, and X op X with the help > > + of the truth_valued_p and logical_inverted_value predicates. */ > > +(match truth_valued_p > > + @0 > > + (if (INTEGRAL_TYPE_P (type) && T

Re: [PATCH][11/n] Merge from match-and-simplify, bit patterns from forwprop

2014-11-06 Thread Richard Biener
On Thu, 6 Nov 2014, Marc Glisse wrote: > On Thu, 6 Nov 2014, Richard Biener wrote: > > > +/* Simplify (A & B) OP0 (C & B) to (A OP0 C) & B. */ > > > +/* (x | CST1) & CST2 -> (x & CST2) | (CST1 & CST2) */ > > As soon as there are 2+ operations in the result, this comment in > fwprop_ssa_val beco

Re: [PATCH][11/n] Merge from match-and-simplify, bit patterns from forwprop

2014-11-06 Thread Marc Glisse
On Thu, 6 Nov 2014, Richard Biener wrote: +/* Try simple folding for X op !X, and X op X with the help + of the truth_valued_p and logical_inverted_value predicates. */ +(match truth_valued_p + @0 + (if (INTEGRAL_TYPE_P (type) && TYPE_PRECISION (type) == 1))) +(for op (lt le eq ne ge gt truth

Re: [PATCH][11/n] Merge from match-and-simplify, bit patterns from forwprop

2014-11-06 Thread Marc Glisse
On Thu, 6 Nov 2014, Richard Biener wrote: +/* Simplify (A & B) OP0 (C & B) to (A OP0 C) & B. */ +/* (x | CST1) & CST2 -> (x & CST2) | (CST1 & CST2) */ As soon as there are 2+ operations in the result, this comment in fwprop_ssa_val becomes outdated, no? /* We continue matching along SS

Re: [PATCH][11/n] Merge from match-and-simplify, bit patterns from forwprop

2014-11-06 Thread pinskia
> On Nov 6, 2014, at 12:55 AM, Richard Biener wrote: > > > This merges patterns implementing the bitwise patterns from > tree-ssa-forwprop.c. I've removed duplicate functionality from > fold-const.c as I found them, some may be still lurking in the > depths. > > This also fixes a bug in g