Re: [PATCH] Fix redundant load missed by fre [tree-optimization 92980]

2020-01-07 Thread Richard Biener
On Wed, Dec 18, 2019 at 10:59 AM Andrew Pinski wrote: > > On Wed, Dec 18, 2019 at 1:18 AM Hongtao Liu wrote: > > > > On Wed, Dec 18, 2019 at 4:26 PM Segher Boessenkool > > wrote: > > > > > > On Wed, Dec 18, 2019 at 10:37:11AM +0800, Hongtao Liu wrote: > > > > Hi: > > > > This patch is to

Re: [PATCH] Fix redundant load missed by fre [tree-optimization 92980]

2019-12-18 Thread Andrew Pinski
On Wed, Dec 18, 2019 at 1:18 AM Hongtao Liu wrote: > > On Wed, Dec 18, 2019 at 4:26 PM Segher Boessenkool > wrote: > > > > On Wed, Dec 18, 2019 at 10:37:11AM +0800, Hongtao Liu wrote: > > > Hi: > > > This patch is to simplify A * C + (-D) -> (A - D/C) * C when C is a > > > power of 2 and D mod

Re: [PATCH] Fix redundant load missed by fre [tree-optimization 92980]

2019-12-18 Thread Hongtao Liu
On Wed, Dec 18, 2019 at 4:26 PM Segher Boessenkool wrote: > > On Wed, Dec 18, 2019 at 10:37:11AM +0800, Hongtao Liu wrote: > > Hi: > > This patch is to simplify A * C + (-D) -> (A - D/C) * C when C is a > > power of 2 and D mod C == 0. > > bootstrap and make check is ok. > > Why would this be

Re: [PATCH] Fix redundant load missed by fre [tree-optimization 92980]

2019-12-18 Thread Segher Boessenkool
On Wed, Dec 18, 2019 at 10:37:11AM +0800, Hongtao Liu wrote: > Hi: > This patch is to simplify A * C + (-D) -> (A - D/C) * C when C is a > power of 2 and D mod C == 0. > bootstrap and make check is ok. Why would this be a good idea? It is not reducing the number of operators or similar?

Re: [PATCH] Fix redundant load missed by fre [tree-optimization 92980]

2019-12-17 Thread Hongtao Liu
On Wed, Dec 18, 2019 at 10:50 AM Andrew Pinski wrote: > > On Tue, Dec 17, 2019 at 6:33 PM Hongtao Liu wrote: > > > > Hi: > > This patch is to simplify A * C + (-D) -> (A - D/C) * C when C is a > > power of 2 and D mod C == 0. > > bootstrap and make check is ok. > > I don't see why D has to

Re: [PATCH] Fix redundant load missed by fre [tree-optimization 92980]

2019-12-17 Thread Andrew Pinski
On Tue, Dec 17, 2019 at 6:33 PM Hongtao Liu wrote: > > Hi: > This patch is to simplify A * C + (-D) -> (A - D/C) * C when C is a > power of 2 and D mod C == 0. > bootstrap and make check is ok. I don't see why D has to be negative here. >TREE_CODE (TREE_TYPE (@0)) == INTEGER_TYPE + &&

[PATCH] Fix redundant load missed by fre [tree-optimization 92980]

2019-12-17 Thread Hongtao Liu
Hi: This patch is to simplify A * C + (-D) -> (A - D/C) * C when C is a power of 2 and D mod C == 0. bootstrap and make check is ok. changelog gcc/ * gcc/match.pd (A * C + (-D) = (A - D/C) * C. when C is a power of 2 and D mod C == 0): Add new simplification. gcc/testsuite