public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <richard.guenther@gmail.com>
To: Marc Glisse <marc.glisse@inria.fr>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: Simple reassoc transforms in match.pd
Date: Mon, 26 Jun 2017 10:16:00 -0000	[thread overview]
Message-ID: <CAFiYyc256MHzqBj4dNDeO_s96DNNZSQHFY-vsVnKDQO65SN1Ow@mail.gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1706231505540.20818@stedding.saclay.inria.fr>

On Fri, Jun 23, 2017 at 3:12 PM, Marc Glisse <marc.glisse@inria.fr> wrote:
> Hello,
>
> here are a few simple transformations, mostly useful for types with
> undefined overflow where we do not have reassoc.
>
> I did not name the testcase reassoc-* to leave that namespace to the realloc
> pass, and -fno-tree-reassoc is just in case someone ever enhances that
> pass...

You probably saw

  /* (T)(P + A) - (T)(P + B) -> (T)A - (T)B */
  (for add (plus pointer_plus)
   (simplify
    (minus (convert (add @@0 @1))
     (convert (add @0 @2)))

as you didn't duplicate its functionality.  It misses a :c in one of
the adds for the
PLUS_EXPR case though so it might be worth splitting that out near to your
added cases?  Which then raises the question of handling conversions around
the inner ops in your patterns?

I think the patch is ok as-is but we could improve this as a followup maybe?

Thanks,
Richard.

> Bootstrap + testsuite on powerpc64le-unknown-linux-gnu.
>
> 2017-06-23  Marc Glisse  <marc.glisse@inria.fr>
>
> gcc/
>         * match.pd ((A+-B)+(C-A), (A+B)-(A-C)): New transformations.
>
> gcc/testsuite/
>         * gcc.dg/tree-ssa/assoc-1.c: New file.
>
> --
> Marc Glisse

  reply	other threads:[~2017-06-26 10:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-23 13:12 Marc Glisse
2017-06-26 10:16 ` Richard Biener [this message]
2017-06-28  7:51   ` Marc Glisse

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAFiYyc256MHzqBj4dNDeO_s96DNNZSQHFY-vsVnKDQO65SN1Ow@mail.gmail.com \
    --to=richard.guenther@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=marc.glisse@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).