public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Richard Biener <richard.guenther@gmail.com>
Cc: Drew Ross <drewross7@gmail.com>, gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] match.pd: Implement missed optimization ((x ^ y) & z) | x -> (z & y) | x [PR109938]
Date: Thu, 10 Aug 2023 12:28:24 +0200	[thread overview]
Message-ID: <ZNS7yHDo6fc85LO0@tucnak> (raw)
In-Reply-To: <CAFiYyc3C_8kQ1f_GfBrckKa9B9Q0RU9gEdiE934ToJQN4eY4HA@mail.gmail.com>

On Tue, Aug 08, 2023 at 03:18:51PM +0200, Richard Biener via Gcc-patches wrote:
> On Fri, Aug 4, 2023 at 11:49 PM Drew Ross via Gcc-patches
> <gcc-patches@gcc.gnu.org> wrote:
> >
> > Adds a simplification for ((x ^ y) & z) | x to be folded into
> > (z & y) | x. Merges this simplification with ((x | y) & z) | x -> (z & y) | x
> > to prevent duplicate pattern. Tested successfully on x86_64 and x86 targets.
> 
> OK.

Shouldn't
  (bit_ior:c (bit_and:cs (bit_ior:cs @0 @1) @2) @0)
be changed to
  (bit_ior:c (nop_convert1?:s
	       (bit_and:cs (nop_convert2?:s (op:cs @0 @1)) @2)) @3)
rather than
  (bit_ior:c (nop_convert1? (bit_and:c (nop_convert2? (op:c @0 @1)) @2)) @3)
in the patch?
I mean the :s modifiers were there for a reason, if some of the
intermediates aren't a single use, then the simplification doesn't simplify
anything and can even make things larger.

	Jakub


  reply	other threads:[~2023-08-10 10:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-04 21:48 Drew Ross
2023-08-08 13:18 ` Richard Biener
2023-08-10 10:28   ` Jakub Jelinek [this message]
2023-08-10 15:43     ` [PATCH] match.pd, v2: " Jakub Jelinek
2023-08-11  7:36       ` Richard Biener

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=ZNS7yHDo6fc85LO0@tucnak \
    --to=jakub@redhat.com \
    --cc=drewross7@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=richard.guenther@gmail.com \
    /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).