public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeff Law <jeffreyalaw@gmail.com>
To: Navid Rahimi <navidrahimi@microsoft.com>,
	Navid Rahimi via Gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH][WIP] PR tree-optimization/101808 Boolean comparison simplification
Date: Tue, 23 Nov 2021 12:14:20 -0700	[thread overview]
Message-ID: <0320449b-433b-1e27-732f-4fd3e17b76b6@gmail.com> (raw)
In-Reply-To: <BN6PR21MB01628850C46353EE1EB0DBE4A3609@BN6PR21MB0162.namprd21.prod.outlook.com>



On 11/23/2021 11:34 AM, Navid Rahimi via Gcc-patches wrote:
> Hi GCC community,
>
> I wanted you take a quick look at this patch to solve this bug [1]. This is the code example for the optimization [2] which does include a link to proof of each different optimization.
>
> I think it should be possible to use simpler approach than what Andrew has used here [3].
>
> P.S. Tested and verified on Linux x86_64.
>
> 1) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101808
> 2) https://compiler-explorer.com/z/Gc448eE3z
> 3) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101808#c1
Don't those match.pd patterns make things worse?  We're taking a single 
expression evaluation (the conditional) and turning it into two logicals 
AFAICT.

For the !x expression, obviously if x is a  constant, then we can 
compute that at compile time and we're going from a single conditional 
to a single logical which is probably a win, but that's not the case 
with this patch AFAICT.

jeff

  reply	other threads:[~2021-11-23 19:14 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-23 18:34 Navid Rahimi
2021-11-23 19:14 ` Jeff Law [this message]
2021-11-23 19:33   ` Andrew Pinski
2021-11-23 19:55     ` [EXTERNAL] " Navid Rahimi
2021-11-23 20:03       ` Jeff Law
2021-11-29 23:51         ` Navid Rahimi
2021-12-03 15:43           ` Jeff Law
2021-11-23 19:42   ` Navid Rahimi
2021-11-23 20:02     ` Jeff Law
2021-11-23 20:08       ` Navid Rahimi
2021-11-23 20:14         ` 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=0320449b-433b-1e27-732f-4fd3e17b76b6@gmail.com \
    --to=jeffreyalaw@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=navidrahimi@microsoft.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).