Re: [PATCH] Canonicalize constant multiplies in division

2017-11-16 Thread Richard Biener
On Wed, Nov 15, 2017 at 3:39 PM, Wilco Dijkstra wrote: > Richard Biener wrote: >> On Tue, Oct 17, 2017 at 6:32 PM, Wilco Dijkstra >> wrote: > >>> (if (flag_reciprocal_math) >>> - /* Convert (A/B)/C to A/(B*C) */ >>> + /* Convert (A/B)/C to A/(B*C). */ >>> (simplify >>>(rdiv (rdiv:s @0 @1

Re: [PATCH] Canonicalize constant multiplies in division

2017-11-15 Thread Wilco Dijkstra
Richard Biener wrote: > On Tue, Oct 17, 2017 at 6:32 PM, Wilco Dijkstra > wrote: >>  (if (flag_reciprocal_math) >> - /* Convert (A/B)/C to A/(B*C)  */ >> + /* Convert (A/B)/C to A/(B*C). */ >>   (simplify >>    (rdiv (rdiv:s @0 @1) @2) >> -   (rdiv @0 (mult @1 @2))) >> +  (rdiv @0 (mult @1 @2)))

Re: [PATCH] Canonicalize constant multiplies in division

2017-10-18 Thread Richard Biener
On Tue, Oct 17, 2017 at 6:32 PM, Wilco Dijkstra wrote: > This patch implements some of the optimizations discussed in > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71026. > > Canonicalize x / (C1 * y) into (x * C2) / y. > > This moves constant multiplies out of the RHS of a division in order > to

[PATCH] Canonicalize constant multiplies in division

2017-10-17 Thread Wilco Dijkstra
This patch implements some of the optimizations discussed in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71026. Canonicalize x / (C1 * y) into (x * C2) / y. This moves constant multiplies out of the RHS of a division in order to allow further simplifications (such as (C1 * x) / (C2 * y) -> (C3 *