public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeff Law <jeffreyalaw@gmail.com>
To: Philipp Tomsich <philipp.tomsich@vrull.eu>
Cc: gcc-patches@gcc.gnu.org,
	Christoph Muellner <christoph.muellner@vrull.eu>,
	Kito Cheng <kito.cheng@gmail.com>,
	Vineet Gupta <vineetg@rivosinc.com>,
	Jeff Law <jlaw@ventanamicro.com>,
	Palmer Dabbelt <palmer@rivosinc.com>
Subject: Re: [PATCH] RISC-V: Handle "(a & twobits) == singlebit" in branches using Zbs
Date: Thu, 17 Nov 2022 09:39:49 -0700	[thread overview]
Message-ID: <b622499f-eed1-fd43-cc18-ac828dd916d4@gmail.com> (raw)
In-Reply-To: <CAAeLtUAMq=XiECQp=giT6o=oeZeAg4W-3f_OH6p3=TeFt6GsFQ@mail.gmail.com>


On 11/17/22 08:12, Philipp Tomsich wrote:
>
> This serves as an assertion only, as that case is non-sensical and
> will be optimized away by earlier passes (as "a & C == T" with C and T
> sharing no bits will always be false).
> IFAIK the preceding transforms should always clean such a check up,
> but we can't exclude the possibility that with enough command line
> overrides and params we might see such a non-sensical test making it
> all the way to the backend.

Good!  I was thinking in the back of my mind that the no-sharing-bits 
case should have been handled in the generic optimizers.  Thanks for 
clarifying.


>
> What would you recommend? Adding this to the pattern's condition feels
> a bit redundant.

We can leave it in the splitter.


> In fact, I am leaning towards hiding the !SMALL_OPERAND check in yet
> another predicate that combines const_twobits_operand with a
> match_test for !SMALL_OPERAND.

Sure.

jeff



  reply	other threads:[~2022-11-17 16:39 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-13 20:48 Philipp Tomsich
2022-11-17 14:58 ` Jeff Law
2022-11-17 15:12   ` Philipp Tomsich
2022-11-17 16:39     ` Jeff Law [this message]
2022-11-17 16:46       ` Philipp Tomsich
2022-11-17 18:25 ` Andrew Pinski
2022-11-17 18:27   ` Andrew Pinski
2022-11-17 18:57     ` Philipp Tomsich
2022-11-17 18:33 ` Andrew Waterman
2022-11-17 18:51   ` Philipp Tomsich
2022-11-17 18:56     ` Andrew Waterman
2022-11-17 18:59       ` Philipp Tomsich

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=b622499f-eed1-fd43-cc18-ac828dd916d4@gmail.com \
    --to=jeffreyalaw@gmail.com \
    --cc=christoph.muellner@vrull.eu \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jlaw@ventanamicro.com \
    --cc=kito.cheng@gmail.com \
    --cc=palmer@rivosinc.com \
    --cc=philipp.tomsich@vrull.eu \
    --cc=vineetg@rivosinc.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).