Re: [PATCH] Simplify mult where both arguments are 0 or 1 (PR tree-optimization/87954).

2019-06-06 Thread Richard Biener
On Wed, Jun 5, 2019 at 3:35 PM Martin Liška wrote: > > On 6/5/19 3:04 PM, Richard Biener wrote: > > On Wed, Jun 5, 2019 at 2:09 PM Martin Liška wrote: > >> > >> On 6/5/19 1:13 PM, Richard Biener wrote: > >>> On Wed, Jun 5, 2019 at 12:56 PM Martin Liška wrote: > > Hi. > > I'm

Re: [PATCH] Simplify mult where both arguments are 0 or 1 (PR tree-optimization/87954).

2019-06-05 Thread Martin Liška
(well, probably not > even that...). But for plus vs or? Hmm, expected speed up will be probably very small. Martin > > >>> >>> X * [0, 1] -> X & sign-extend-from-bit-1 also works I guess, but >>> multiplication >>> looks more canonical. &g

Re: [PATCH] Simplify mult where both arguments are 0 or 1 (PR tree-optimization/87954).

2019-06-05 Thread Richard Biener
On Wed, Jun 5, 2019 at 2:09 PM Martin Liška wrote: > > On 6/5/19 1:13 PM, Richard Biener wrote: > > On Wed, Jun 5, 2019 at 12:56 PM Martin Liška wrote: > >> > >> Hi. > >> > >> I'm suggesting one multiplication simplification pattern. > >> > >> Patch can bootstrap on x86_64-linux-gnu and survives

Re: [PATCH] Simplify mult where both arguments are 0 or 1 (PR tree-optimization/87954).

2019-06-05 Thread Richard Sandiford
Martin Liška writes: > On 6/5/19 1:13 PM, Richard Biener wrote: >> On Wed, Jun 5, 2019 at 12:56 PM Martin Liška wrote: >>> >>> Hi. >>> >>> I'm suggesting one multiplication simplification pattern. >>> >>> Patch can bootstrap on x86_64-linux-gnu and survives regression tests. >>> >>> Ready to be i

Re: [PATCH] Simplify mult where both arguments are 0 or 1 (PR tree-optimization/87954).

2019-06-05 Thread Martin Liška
On 6/5/19 1:13 PM, Richard Biener wrote: > On Wed, Jun 5, 2019 at 12:56 PM Martin Liška wrote: >> >> Hi. >> >> I'm suggesting one multiplication simplification pattern. >> >> Patch can bootstrap on x86_64-linux-gnu and survives regression tests. >> >> Ready to be installed? > > + (if (INTEGRAL_T

Re: [PATCH] Simplify mult where both arguments are 0 or 1 (PR tree-optimization/87954).

2019-06-05 Thread Richard Biener
On Wed, Jun 5, 2019 at 12:56 PM Martin Liška wrote: > > Hi. > > I'm suggesting one multiplication simplification pattern. > > Patch can bootstrap on x86_64-linux-gnu and survives regression tests. > > Ready to be installed? + (if (INTEGRAL_TYPE_P (type) + && wi::eq_p (get_nonzero_bits (@1)

[PATCH] Simplify mult where both arguments are 0 or 1 (PR tree-optimization/87954).

2019-06-05 Thread Martin Liška
Hi. I'm suggesting one multiplication simplification pattern. Patch can bootstrap on x86_64-linux-gnu and survives regression tests. Ready to be installed? Thanks, Martin gcc/ChangeLog: 2019-06-05 Martin Liska PR tree-optimization/87954 * match.pd: Simplify mult where both