Re: [PATCH] match.pd: Add ~(X - Y) -> ~X + Y simplification [PR96685]

2021-01-14 Thread Richard Biener
On Thu, 14 Jan 2021, Maciej W. Rozycki wrote: > On Tue, 12 Jan 2021, Richard Biener wrote: > > > >>> The point of the match.pd changes is to canonicalize GIMPLE on some form > > >>> when there are several from GIMPLE POV equivalent or better forms of > > >>> writing > > >>> the same thing. The a

Re: [PATCH] match.pd: Add ~(X - Y) -> ~X + Y simplification [PR96685]

2021-01-14 Thread Maciej W. Rozycki
On Tue, 12 Jan 2021, Richard Biener wrote: > >>> The point of the match.pd changes is to canonicalize GIMPLE on some form > >>> when there are several from GIMPLE POV equivalent or better forms of > >>> writing > >>> the same thing. The advantage of having one canonical way is that ICF, > >>> SCC

Re: [PATCH] match.pd: Add ~(X - Y) -> ~X + Y simplification [PR96685]

2021-01-12 Thread Richard Biener
On Mon, 11 Jan 2021, Jeff Law wrote: On 1/9/21 5:43 PM, Maciej W. Rozycki wrote: On Mon, 21 Dec 2020, Jakub Jelinek wrote: This patch adds the ~(X - Y) -> ~X + Y simplification requested in the PR (plus also ~(X + C) -> ~X + (-C) for constants C that can be safely negated. This regress

Re: [PATCH] match.pd: Add ~(X - Y) -> ~X + Y simplification [PR96685]

2021-01-11 Thread Jeff Law via Gcc-patches
On 1/9/21 5:43 PM, Maciej W. Rozycki wrote: > On Mon, 21 Dec 2020, Jakub Jelinek wrote: > This patch adds the ~(X - Y) -> ~X + Y simplification requested in the PR (plus also ~(X + C) -> ~X + (-C) for constants C that can be safely negated. >>> This regresses VAX code produced by

Re: [PATCH] match.pd: Add ~(X - Y) -> ~X + Y simplification [PR96685]

2021-01-09 Thread Maciej W. Rozycki
On Mon, 21 Dec 2020, Jakub Jelinek wrote: > > > This patch adds the ~(X - Y) -> ~X + Y simplification requested > > > in the PR (plus also ~(X + C) -> ~X + (-C) for constants C that can > > > be safely negated. > > > > This regresses VAX code produced by the cmpelim-eq-notsi.c test case (and >

Re: [PATCH] match.pd: Add ~(X - Y) -> ~X + Y simplification [PR96685]

2020-12-20 Thread Jakub Jelinek via Gcc-patches
On Mon, Dec 21, 2020 at 02:50:24AM +, Maciej W. Rozycki wrote: > On Sat, 12 Dec 2020, Jakub Jelinek via Gcc-patches wrote: > > > This patch adds the ~(X - Y) -> ~X + Y simplification requested > > in the PR (plus also ~(X + C) -> ~X + (-C) for constants C that can > > be safely negated. > >

Re: [PATCH] match.pd: Add ~(X - Y) -> ~X + Y simplification [PR96685]

2020-12-20 Thread Maciej W. Rozycki
On Sat, 12 Dec 2020, Jakub Jelinek via Gcc-patches wrote: > This patch adds the ~(X - Y) -> ~X + Y simplification requested > in the PR (plus also ~(X + C) -> ~X + (-C) for constants C that can > be safely negated. This regresses VAX code produced by the cmpelim-eq-notsi.c test case (and its si

Re: [PATCH] match.pd: Add ~(X - Y) -> ~X + Y simplification [PR96685]

2020-12-12 Thread Jakub Jelinek via Gcc-patches
On Sat, Dec 12, 2020 at 02:00:49PM +0100, Marc Glisse wrote: > > Extending it to non-constants is what I wanted to avoid. > > For ~(X + Y), because + is commutative, it wouldn't be a canonicalization > > as it would pick more-less randomly whether to do ~X + Y or X + ~Y. > > ~X - Y or ~Y - X I gue

Re: [PATCH] match.pd: Add ~(X - Y) -> ~X + Y simplification [PR96685]

2020-12-12 Thread Marc Glisse
On Sat, 12 Dec 2020, Jakub Jelinek via Gcc-patches wrote: On Sat, Dec 12, 2020 at 01:25:39PM +0100, Marc Glisse wrote: On Sat, 12 Dec 2020, Jakub Jelinek via Gcc-patches wrote: This patch adds the ~(X - Y) -> ~X + Y simplification requested in the PR (plus also ~(X + C) -> ~X + (-C) for const

Re: [PATCH] match.pd: Add ~(X - Y) -> ~X + Y simplification [PR96685]

2020-12-12 Thread Jakub Jelinek via Gcc-patches
On Sat, Dec 12, 2020 at 01:25:39PM +0100, Marc Glisse wrote: > On Sat, 12 Dec 2020, Jakub Jelinek via Gcc-patches wrote: > > > This patch adds the ~(X - Y) -> ~X + Y simplification requested > > in the PR (plus also ~(X + C) -> ~X + (-C) for constants C that can > > be safely negated. > > Would i

Re: [PATCH] match.pd: Add ~(X - Y) -> ~X + Y simplification [PR96685]

2020-12-12 Thread Marc Glisse
On Sat, 12 Dec 2020, Jakub Jelinek via Gcc-patches wrote: This patch adds the ~(X - Y) -> ~X + Y simplification requested in the PR (plus also ~(X + C) -> ~X + (-C) for constants C that can be safely negated. Would it have been wrong to produce ~X - C without caring about negating (and then e

Re: [PATCH] match.pd: Add ~(X - Y) -> ~X + Y simplification [PR96685]

2020-12-12 Thread Richard Biener
On December 12, 2020 9:10:41 AM GMT+01:00, Jakub Jelinek wrote: >Hi! > >This patch adds the ~(X - Y) -> ~X + Y simplification requested >in the PR (plus also ~(X + C) -> ~X + (-C) for constants C that can >be safely negated. > >The first two simplify blocks is what has been requested in the PR >a

[PATCH] match.pd: Add ~(X - Y) -> ~X + Y simplification [PR96685]

2020-12-12 Thread Jakub Jelinek via Gcc-patches
Hi! This patch adds the ~(X - Y) -> ~X + Y simplification requested in the PR (plus also ~(X + C) -> ~X + (-C) for constants C that can be safely negated. The first two simplify blocks is what has been requested in the PR and that makes the first testcase pass. Unfortunately, that change also bre