public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeff Law <jeffreyalaw@gmail.com>
To: Andrew Pinski <apinski@marvell.com>, gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] For the `-A CMP -B -> B CMP A` pattern allow EQ/NE for all integer types
Date: Tue, 6 Jun 2023 20:53:26 -0600	[thread overview]
Message-ID: <b79cfb95-d8de-79d7-d1ab-fc2e645396a1@gmail.com> (raw)
In-Reply-To: <20230606210710.2992237-1-apinski@marvell.com>



On 6/6/23 15:07, Andrew Pinski via Gcc-patches wrote:
> I noticed while looking at some code generation issue, that forwprop
> was not handling `-a == 0` for unsigned types and I was confused why
> it was not.
> r6-1814-g66e1cacf608045 removed these from fold because they
> were supposed to be already handled by the match.pd patterns
> but it was missed that the match.pd patterns checked
> TYPE_OVERFLOW_UNDEFINED while fold didn't do that for NE/EQ.
> This patch removes the restriction on NE/EQ on TYPE_OVERFLOW_UNDEFINED.
> 
> OK? Bootstrapped and tested on x86_64-linux-gnu.
> 
> gcc/ChangeLog:
> 
> 	PR tree-optimization/110134
> 	* match.pd (-A CMP -B -> B CMP A): Allow EQ/NE for all integer
> 	types.
> 	(-A CMP CST -> B CMP (-CST)): Likewise.
> 
> gcc/testsuite/ChangeLog:
> 
> 	PR tree-optimization/110134
> 	* gcc.dg/tree-ssa/negneq-1.c: New test.
> 	* gcc.dg/tree-ssa/negneq-2.c: New test.
> 	* gcc.dg/tree-ssa/negneq-3.c: New test.
> 	* gcc.dg/tree-ssa/negneq-4.c: New test.
OK.
jeff

      reply	other threads:[~2023-06-07  2:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-06 21:07 Andrew Pinski
2023-06-07  2:53 ` 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=b79cfb95-d8de-79d7-d1ab-fc2e645396a1@gmail.com \
    --to=jeffreyalaw@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).