Re: Multiply Optimization in match and Simplify

2015-11-03 Thread Richard Biener
On Tue, Nov 3, 2015 at 6:12 AM, Hurugalawadi, Naveen wrote: > Hi, > > Thanks for the review and suggestions. > >>> Please do not drop A - B -> A + (-B) from fold-const as match.pd >>> doesn't implement all of fold-const.c negate_expr_p support. > > Done. > >>> which is more expensive. This means

Re: Multiply Optimization in match and Simplify

2015-11-02 Thread Hurugalawadi, Naveen
Hi, Thanks for the review and suggestions. >> Please do not drop A - B -> A + (-B) from fold-const as match.pd >> doesn't implement all of fold-const.c negate_expr_p support. Done. >> which is more expensive. This means that we miss a >> (bit_and (bit_not @0) INTEGER_CST@1) Should we have thi

Re: Multiply Optimization in match and Simplify

2015-10-30 Thread Richard Biener
On Fri, Oct 30, 2015 at 11:26 AM, Marc Glisse wrote: > On Fri, 30 Oct 2015, Richard Biener wrote: > >> +/* Convert (A + A) * C -> A * 2 * C. */ >> +(simplify >> + (mult:c (convert? (plus @0 @0)) (convert? @1)) >> + (if (tree_nop_conversion_p (TREE_TYPE (@0), type)) >> + (convert (mult @0 (mult

Re: Multiply Optimization in match and Simplify

2015-10-30 Thread Marc Glisse
On Fri, 30 Oct 2015, Richard Biener wrote: +/* Convert (A + A) * C -> A * 2 * C. */ +(simplify + (mult:c (convert? (plus @0 @0)) (convert? @1)) + (if (tree_nop_conversion_p (TREE_TYPE (@0), type)) + (convert (mult @0 (mult { build_int_cst (TREE_TYPE (@1), 2); } @1) +(simplify + (mult:c (

Re: Multiply Optimization in match and Simplify

2015-10-30 Thread Richard Biener
On Thu, Oct 29, 2015 at 5:34 AM, Hurugalawadi, Naveen wrote: > Hi, > > Please find attached the patch that moves some multiply optimizations > from fold-const using simplify and match. > > Please review the patch and let me know if any modifications are required. > > Tested the patch on X86. > > O

Multiply Optimization in match and Simplify

2015-10-28 Thread Hurugalawadi, Naveen
Hi, Please find attached the patch that moves some multiply optimizations from fold-const using simplify and match. Please review the patch and let me know if any modifications are required. Tested the patch on X86. Observing following failures:- >> FAIL: gcc.dg/fold-plusmult.c scan-tree-dump-