This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Simplify 3*x == 3*y for wrapping types
- From: Andrew Pinski <pinskia at gmail dot com>
- To: Marc Glisse <marc dot glisse at inria dot fr>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Sat, 24 Jun 2017 09:30:52 -0700
- Subject: Re: Simplify 3*x == 3*y for wrapping types
- Authentication-results: sourceware.org; auth=none
- References: <alpine.DEB.2.02.1706241411140.22250@stedding.saclay.inria.fr>
On Sat, Jun 24, 2017 at 5:34 AM, Marc Glisse <marc.glisse@inria.fr> wrote:
> Hello,
>
> I remember wanting to add this when the undefined-overflow case was
> introduced a while ago.
>
> It turns out the tree where I wrote this wasn't clean. Since the rest is
> details, I am including it in this patch, hope it is ok.
You can do the x * C1 == y * C1 optimization for floating point (if
-ffast-math). That is recorded as PR 31098.
Thanks,
Andrew
>
> Bootstrap + testsuite on powerpc64le-unknown-linux-gnu.
>
> 2017-06-26 Marc Glisse <marc.glisse@inria.fr>
>
> gcc/
> * match.pd ((X & ~Y) | (~X & Y)): Generalize to + and ^.
> (x * C EQ/NE y * C): New transformation.
>
> gcc/testsuite/
> * gcc.dg/tree-ssa/addadd.c: Remove test duplicated in addadd-2.c.
> * gcc.dg/tree-ssa/mulcmp-1.c: New file.
>
> --
> Marc Glisse