This is the mail archive of the
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.firstname.lastname@example.org>
On Sat, Jun 24, 2017 at 5:34 AM, Marc Glisse <email@example.com> wrote:
> 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.
> Bootstrap + testsuite on powerpc64le-unknown-linux-gnu.
> 2017-06-26 Marc Glisse <firstname.lastname@example.org>
> * match.pd ((X & ~Y) | (~X & Y)): Generalize to + and ^.
> (x * C EQ/NE y * C): New transformation.
> * gcc.dg/tree-ssa/addadd.c: Remove test duplicated in addadd-2.c.
> * gcc.dg/tree-ssa/mulcmp-1.c: New file.
> Marc Glisse