public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <richard.guenther@gmail.com>
To: Andrew Pinski <apinski@marvell.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] MATCH: Remove redundant pattern for `(x | y) & ~x`
Date: Mon, 28 Aug 2023 09:02:38 +0200	[thread overview]
Message-ID: <CAFiYyc20SZoK5f_BxkwC73CEr6j=CU5RbG9kjmWOawag7vohEA@mail.gmail.com> (raw)
In-Reply-To: <20230828035253.3745942-1-apinski@marvell.com>

On Mon, Aug 28, 2023 at 5:54 AM Andrew Pinski via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> After r14-2885-gb9237226fdc938, this pattern becomes
> redundant as we match it using bitwise_inverted_equal_p.
>
> There is already a testcase (gcc.dg/nand.c) for this pattern
> and it still passes after the removal.
>
> OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions.

OK.

> gcc/ChangeLog:
>
>         PR tree-optimization/111146
>         * match.pd (`(x | y) & ~x`, `(x & y) | ~x`): Remove
>         redundant pattern.
> ---
>  gcc/match.pd | 8 --------
>  1 file changed, 8 deletions(-)
>
> diff --git a/gcc/match.pd b/gcc/match.pd
> index fa598d5ca2e..0076392c522 100644
> --- a/gcc/match.pd
> +++ b/gcc/match.pd
> @@ -1556,14 +1556,6 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
>   (bit_ior:c (bit_xor:s @0 @1) (bit_not:s (bit_ior:s @0 @1)))
>   (bit_not (bit_and @0 @1)))
>
> -/* (x | y) & ~x -> y & ~x */
> -/* (x & y) | ~x -> y | ~x */
> -(for bitop (bit_and bit_ior)
> -     rbitop (bit_ior bit_and)
> - (simplify
> -  (bitop:c (rbitop:c @0 @1) (bit_not@2 @0))
> -  (bitop @1 @2)))
> -
>  /* (x & y) ^ (x | y) -> x ^ y */
>  (simplify
>   (bit_xor:c (bit_and @0 @1) (bit_ior @0 @1))
> --
> 2.31.1
>

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

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-28  3:52 Andrew Pinski
2023-08-28  7:02 ` Richard Biener [this message]

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='CAFiYyc20SZoK5f_BxkwC73CEr6j=CU5RbG9kjmWOawag7vohEA@mail.gmail.com' \
    --to=richard.guenther@gmail.com \
    --cc=apinski@marvell.com \
    --cc=gcc-patches@gcc.gnu.org \
    /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).