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>, rv@rasmusvillemoes.dk
Subject: Re: [PATCH 2/4] match.pd: Add x & ~(x & y) -> x & ~y pattern
Date: Thu, 22 Jan 2015 09:24:00 -0000	[thread overview]
Message-ID: <CAFiYyc0p9Um0YKwQFYqEjt003zaFLXUprz6-eiizRSQSUH-4CA@mail.gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.11.1501212001150.28775@stedding.saclay.inria.fr>

On Wed, Jan 21, 2015 at 9:00 PM, Marc Glisse <marc.glisse@inria.fr> wrote:
> Hello,
>
> (sorry for the broken thread, for some reason I haven't received any email
> from gcc since about 10am, I'll investigate later)
>
> +/* x & ~(x & y) -> x & ~y */
> +(simplify
> + (bit_and:c @0 (bit_not (bit_and:c@2 @0 @1)))
> + (if (TREE_CODE (@2) != SSA_NAME || has_single_use (@2))
> +  (bit_and @0 (bit_not @1))))
>
> Wouldn't it make more sense to put @2 on bit_not? If bit_and is used
> multiple times, the transformation is neutral so it should be done as a
> canonicalization. On the other hand, if bit_not is used multiple times, the
> transformation adds an extra bit_not (which might be free when there is an
> andn insn). So I believe the 2 main options are:
> - move @2 on the bit_not
> - don't test has_single_use at all

I tend to favor not testing has_single_use at all.

Richard.

> --
> Marc Glisse

  reply	other threads:[~2015-01-22  8:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-21 21:24 Marc Glisse
2015-01-22  9:24 ` Richard Biener [this message]
2015-01-22 14:24   ` Rasmus Villemoes
  -- strict thread matches above, loose matches on Subject: below --
2015-01-14 14:01 RFC: Two minor optimization patterns Richard Biener
2015-01-21 10:50 ` [PATCH 0/4] A few " Rasmus Villemoes
2015-01-21 10:55   ` [PATCH 2/4] match.pd: Add x & ~(x & y) -> x & ~y pattern Rasmus Villemoes
2015-05-01 18:29     ` Jeff Law

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=CAFiYyc0p9Um0YKwQFYqEjt003zaFLXUprz6-eiizRSQSUH-4CA@mail.gmail.com \
    --to=richard.guenther@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=marc.glisse@inria.fr \
    --cc=rv@rasmusvillemoes.dk \
    /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).