From: Jeff Law <jeffreyalaw@gmail.com>
To: Andrew Pinski <quic_apinski@quicinc.com>, gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] Match: Improve inverted_equal_p for bool and `^` and `==` [PR113186]
Date: Thu, 4 Jan 2024 12:50:06 -0700 [thread overview]
Message-ID: <9b7a45f1-a8ec-4817-ad71-20e24a4969c6@gmail.com> (raw)
In-Reply-To: <20240101040329.3895909-1-quic_apinski@quicinc.com>
On 12/31/23 21:03, Andrew Pinski wrote:
> For boolean types, `a ^ b` is a valid form for `a != b`. This means for
> gimple_bitwise_inverted_equal_p, we catch some inverted value forms. This
> patch extends inverted_equal_p to allow matching of `^` with the
> corresponding `==`. Note in the testcase provided we used to optimize
> in GCC 12 to just `return 0` where `a == b` was used,
> this allows us to do that again.
>
> Bootstrapped and tested on x86_64-linux-gnu with no regressions.
>
> PR tree-optimized/113186
>
> gcc/ChangeLog:
>
> * gimple-match-head.cc (gimple_bitwise_inverted_equal_p):
> Match `^` with the `==` for 1bit integral types.
> * match.pd (maybe_cmp): Allow for bit_xor for 1bit
> integral types.
>
> gcc/testsuite/ChangeLog:
>
> * gcc.dg/tree-ssa/bitops-bool-1.c: New test.
OK
jeff
prev parent reply other threads:[~2024-01-04 19:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-01 4:03 Andrew Pinski
2024-01-04 19:50 ` Jeff Law [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=9b7a45f1-a8ec-4817-ad71-20e24a4969c6@gmail.com \
--to=jeffreyalaw@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=quic_apinski@quicinc.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).